allocation.asciidoc 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. [[cat-allocation]]
  2. === cat allocation API
  3. ++++
  4. <titleabbrev>cat allocation</titleabbrev>
  5. ++++
  6. Provides a snapshot of the number of shards allocated to each data node
  7. and their disk space.
  8. [[cat-allocation-api-request]]
  9. ==== {api-request-title}
  10. `GET /_cat/allocation/<node_id>`
  11. `GET /_cat/allocation`
  12. [[cat-allocation-api-path-params]]
  13. ==== {api-path-parms-title}
  14. include::{docdir}/rest-api/common-parms.asciidoc[tag=node-id]
  15. [[cat-allocation-api-query-params]]
  16. ==== {api-query-parms-title}
  17. include::{docdir}/rest-api/common-parms.asciidoc[tag=bytes]
  18. include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
  19. include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
  20. include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  21. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
  22. include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
  23. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
  24. include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
  25. [[cat-allocation-api-example]]
  26. ==== {api-examples-title}
  27. [source,console,id=cat-allocation-example]
  28. --------------------------------------------------
  29. GET /_cat/allocation?v
  30. --------------------------------------------------
  31. // TEST[s/^/PUT test\n{"settings": {"number_of_replicas": 0}}\n/]
  32. The API returns the following response:
  33. [source,txt]
  34. --------------------------------------------------
  35. shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
  36. 1 260b 47.3gb 43.4gb 100.7gb 46 127.0.0.1 127.0.0.1 CSUXak2
  37. --------------------------------------------------
  38. // TESTRESPONSE[s/\d+(\.\d+)?[tgmk]?b/\\d+(\\.\\d+)?[tgmk]?b/ s/46/\\d+/]
  39. // TESTRESPONSE[s/CSUXak2/.+/ non_json]
  40. This response shows a single shard is allocated to the one node available.