slm-stats.asciidoc 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. [role="xpack"]
  2. [[slm-api-get-stats]]
  3. === Get snapshot lifecycle stats API
  4. ++++
  5. <titleabbrev>Get snapshot lifecycle stats</titleabbrev>
  6. ++++
  7. Returns global and policy-level statistics about actions taken by {slm}.
  8. [[slm-api-stats-request]]
  9. ==== {api-request-title}
  10. `GET /_slm/stats`
  11. [[slm-api-stats-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-stats-example]]
  17. ==== {api-examples-title}
  18. [source,console]
  19. --------------------------------------------------
  20. GET /_slm/stats
  21. --------------------------------------------------
  22. The API returns the following response:
  23. [source,js]
  24. --------------------------------------------------
  25. {
  26. "retention_runs": 13,
  27. "retention_failed": 0,
  28. "retention_timed_out": 0,
  29. "retention_deletion_time": "1.4s",
  30. "retention_deletion_time_millis": 1404,
  31. "policy_stats": [ ],
  32. "total_snapshots_taken": 1,
  33. "total_snapshots_failed": 1,
  34. "total_snapshots_deleted": 0,
  35. "total_snapshot_deletion_failures": 0
  36. }
  37. --------------------------------------------------
  38. // TESTRESPONSE[s/runs": 13/runs": $body.retention_runs/ s/_failed": 0/_failed": $body.retention_failed/ s/_timed_out": 0/_timed_out": $body.retention_timed_out/ s/"1.4s"/$body.retention_deletion_time/ s/1404/$body.retention_deletion_time_millis/ s/total_snapshots_taken": 1/total_snapshots_taken": $body.total_snapshots_taken/ s/total_snapshots_failed": 1/total_snapshots_failed": $body.total_snapshots_failed/ s/"policy_stats": \[.*\]/"policy_stats": $body.policy_stats/]