slm-stats.asciidoc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. [[slm-api-get-stats]]
  2. === Get snapshot lifecycle stats API
  3. ++++
  4. <titleabbrev>Get snapshot lifecycle stats</titleabbrev>
  5. ++++
  6. Returns global and policy-level statistics about actions taken by {slm}.
  7. [[slm-api-stats-request]]
  8. ==== {api-request-title}
  9. `GET /_slm/stats`
  10. [[slm-api-stats-prereqs]]
  11. ==== {api-prereq-title}
  12. If the {es} {security-features} are enabled, you must have the `manage_slm`
  13. cluster privilege to use this API. For more information, see
  14. <<security-privileges>>.
  15. [[slm-api-stats-example]]
  16. ==== {api-examples-title}
  17. [source,console]
  18. --------------------------------------------------
  19. GET /_slm/stats
  20. --------------------------------------------------
  21. The API returns the following response:
  22. [source,js]
  23. --------------------------------------------------
  24. {
  25. "retention_runs": 13,
  26. "retention_failed": 0,
  27. "retention_timed_out": 0,
  28. "retention_deletion_time": "1.4s",
  29. "retention_deletion_time_millis": 1404,
  30. "policy_stats": [ ],
  31. "total_snapshots_taken": 1,
  32. "total_snapshots_failed": 1,
  33. "total_snapshots_deleted": 0,
  34. "total_snapshot_deletion_failures": 0
  35. }
  36. --------------------------------------------------
  37. // 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/]