slm-stats.asciidoc 1.6 KB

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