nodes-usage.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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,js]
  36. --------------------------------------------------
  37. GET _nodes/usage
  38. --------------------------------------------------
  39. // CONSOLE
  40. // TEST[setup:node]
  41. The API returns the following response:
  42. [source,js]
  43. --------------------------------------------------
  44. {
  45. "_nodes": {
  46. "total": 1,
  47. "successful": 1,
  48. "failed": 0
  49. },
  50. "cluster_name": "my_cluster",
  51. "nodes": {
  52. "pQHNt5rXTTWNvUgOrdynKg": {
  53. "timestamp": 1492553961812, <1>
  54. "since": 1492553906606, <2>
  55. "rest_actions": {
  56. "org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
  57. "org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
  58. "org.elasticsearch.rest.action.document.RestGetAction": 1,
  59. "org.elasticsearch.rest.action.search.RestSearchAction": 19, <3>
  60. "org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
  61. }
  62. }
  63. }
  64. }
  65. --------------------------------------------------
  66. // TESTRESPONSE[s/"my_cluster"/$body.cluster_name/]
  67. // TESTRESPONSE[s/"pQHNt5rXTTWNvUgOrdynKg"/\$node_name/]
  68. // TESTRESPONSE[s/1492553961812/$body.$_path/]
  69. // TESTRESPONSE[s/1492553906606/$body.$_path/]
  70. // TESTRESPONSE[s/"rest_actions": [^}]+}/"rest_actions": $body.$_path/]
  71. <1> Timestamp for when this nodes usage request was performed.
  72. <2> Timestamp for when the usage information recording was started. This is
  73. equivalent to the time that the node was started.
  74. <3> Search action has been called 19 times for this node.