nodes-usage.asciidoc 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. [[cluster-nodes-usage]]
  2. === Nodes Feature Usage
  3. Returns information on the usage of features.
  4. [[cluster-nodes-usage-api-request]]
  5. ==== {api-request-title}
  6. `GET /_nodes/usage` +
  7. `GET /_nodes/<node_id>/usage` +
  8. `GET /_nodes/usage/<metric>` +
  9. `GET /_nodes/<node_id>/usage/<metric>`
  10. [[cluster-nodes-usage-api-desc]]
  11. ==== {api-description-title}
  12. The cluster nodes usage API allows you to retrieve information on the usage
  13. of features for each node. All the nodes selective options are explained
  14. <<cluster-nodes,here>>.
  15. [[cluster-nodes-usage-api-path-params]]
  16. ==== {api-path-parms-title}
  17. `<metric>`::
  18. (Optional, string) Limits the information returned to the specific metrics.
  19. A comma-separated list of the following options:
  20. +
  21. --
  22. `_all`::
  23. Returns all stats.
  24. `rest_actions`::
  25. Returns the REST actions classname with a count of the number of times
  26. that action has been called on the node.
  27. --
  28. include::{docdir}/rest-api/common-parms.asciidoc[tag=node-id]
  29. [[cluster-nodes-usage-api-query-params]]
  30. ==== {api-query-parms-title}
  31. include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  32. [[cluster-nodes-usage-api-example]]
  33. ==== {api-examples-title}
  34. Rest action example:
  35. [source,console]
  36. --------------------------------------------------
  37. GET _nodes/usage
  38. --------------------------------------------------
  39. // TEST[setup:node]
  40. The API returns the following response:
  41. [source,console-result]
  42. --------------------------------------------------
  43. {
  44. "_nodes": {
  45. "total": 1,
  46. "successful": 1,
  47. "failed": 0
  48. },
  49. "cluster_name": "my_cluster",
  50. "nodes": {
  51. "pQHNt5rXTTWNvUgOrdynKg": {
  52. "timestamp": 1492553961812, <1>
  53. "since": 1492553906606, <2>
  54. "rest_actions": {
  55. "org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
  56. "org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
  57. "org.elasticsearch.rest.action.document.RestGetAction": 1,
  58. "org.elasticsearch.rest.action.search.RestSearchAction": 19, <3>
  59. "org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
  60. }
  61. }
  62. }
  63. }
  64. --------------------------------------------------
  65. // TESTRESPONSE[s/"my_cluster"/$body.cluster_name/]
  66. // TESTRESPONSE[s/"pQHNt5rXTTWNvUgOrdynKg"/\$node_name/]
  67. // TESTRESPONSE[s/1492553961812/$body.$_path/]
  68. // TESTRESPONSE[s/1492553906606/$body.$_path/]
  69. // TESTRESPONSE[s/"rest_actions": [^}]+}/"rest_actions": $body.$_path/]
  70. <1> Timestamp for when this nodes usage request was performed.
  71. <2> Timestamp for when the usage information recording was started. This is
  72. equivalent to the time that the node was started.
  73. <3> Search action has been called 19 times for this node.