repository-stats.asciidoc 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. [role="xpack"]
  2. [testenv="enterprise"]
  3. [[searchable-snapshots-repository-stats]]
  4. === Searchable snapshot repository statistics API
  5. ++++
  6. <titleabbrev>Searchable snapshot repository statistics</titleabbrev>
  7. ++++
  8. experimental[]
  9. Retrieve usage statistics about a snapshot repository.
  10. [[searchable-snapshots-repository-stats-request]]
  11. ==== {api-request-title}
  12. `GET /_snapshot/<repository>/_stats`
  13. [[searchable-snapshots-repository-stats-prereqs]]
  14. ==== {api-prereq-title}
  15. If the {es} {security-features} are enabled, you must have the
  16. `manage` cluster privilege and the `manage` index privilege
  17. for any included indices to use this API.
  18. For more information, see <<security-privileges>>.
  19. [[searchable-snapshots-repository-stats-desc]]
  20. ==== {api-description-title}
  21. [[searchable-snapshots-repository-stats-path-params]]
  22. ==== {api-path-parms-title}
  23. `<repository>`::
  24. (Required, string)
  25. The repository for which to retrieve stats.
  26. [[searchable-snapshots-repository-stats-example]]
  27. ==== {api-examples-title}
  28. ////
  29. [source,console]
  30. -----------------------------------
  31. PUT /docs
  32. {
  33. "settings" : {
  34. "index.number_of_shards" : 1,
  35. "index.number_of_replicas" : 0
  36. }
  37. }
  38. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  39. {
  40. "include_global_state": false,
  41. "indices": "docs"
  42. }
  43. DELETE /docs
  44. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  45. {
  46. "index": "docs"
  47. }
  48. -----------------------------------
  49. // TEST[setup:setup-repository]
  50. ////
  51. Retrieves the statistics of the repository `my_repository`:
  52. [source,console]
  53. --------------------------------------------------
  54. GET /_snapshot/my_repository/_stats
  55. --------------------------------------------------
  56. // TEST[continued]