nodes-usage.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. [[cluster-nodes-usage]]
  2. === Nodes feature usage API
  3. ++++
  4. <titleabbrev>Nodes feature usage</titleabbrev>
  5. ++++
  6. ..New API reference
  7. [sidebar]
  8. --
  9. For the most up-to-date API details, refer to {api-es}/group/endpoint-cluster[Cluster APIs].
  10. --
  11. Returns information on the usage of features.
  12. [[cluster-nodes-usage-api-request]]
  13. ==== {api-request-title}
  14. `GET /_nodes/usage` +
  15. `GET /_nodes/<node_id>/usage` +
  16. `GET /_nodes/usage/<metric>` +
  17. `GET /_nodes/<node_id>/usage/<metric>`
  18. [[cluster-nodes-usage-api-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have the `monitor` or
  21. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  22. [[cluster-nodes-usage-api-desc]]
  23. ==== {api-description-title}
  24. The cluster nodes usage API allows you to retrieve information on the usage
  25. of features for each node. All the nodes selective options are explained
  26. <<cluster-nodes,here>>.
  27. [[cluster-nodes-usage-api-path-params]]
  28. ==== {api-path-parms-title}
  29. `<metric>`::
  30. (Optional, string) Limits the information returned to the specific metrics.
  31. A comma-separated list of the following options:
  32. +
  33. --
  34. `_all`::
  35. Returns all stats.
  36. `rest_actions`::
  37. Returns the REST actions classname with a count of the number of times
  38. that action has been called on the node.
  39. --
  40. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=node-id]
  41. [[cluster-nodes-usage-api-query-params]]
  42. ==== {api-query-parms-title}
  43. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeout-nodes-request]
  44. [[cluster-nodes-usage-api-example]]
  45. ==== {api-examples-title}
  46. Rest action example:
  47. [source,console]
  48. --------------------------------------------------
  49. GET _nodes/usage
  50. --------------------------------------------------
  51. // TEST[setup:node]
  52. The API returns the following response:
  53. [source,console-result]
  54. --------------------------------------------------
  55. {
  56. "_nodes": {
  57. "total": 1,
  58. "successful": 1,
  59. "failed": 0
  60. },
  61. "cluster_name": "my_cluster",
  62. "nodes": {
  63. "pQHNt5rXTTWNvUgOrdynKg": {
  64. "timestamp": 1492553961812, <1>
  65. "since": 1492553906606, <2>
  66. "rest_actions": {
  67. "nodes_usage_action": 1,
  68. "create_index_action": 1,
  69. "document_get_action": 1,
  70. "search_action": 19, <3>
  71. "nodes_info_action": 36
  72. },
  73. "aggregations": {
  74. ...
  75. }
  76. }
  77. }
  78. }
  79. --------------------------------------------------
  80. // TESTRESPONSE[s/"my_cluster"/$body.cluster_name/]
  81. // TESTRESPONSE[s/"pQHNt5rXTTWNvUgOrdynKg"/\$node_name/]
  82. // TESTRESPONSE[s/1492553961812/$body.$_path/]
  83. // TESTRESPONSE[s/1492553906606/$body.$_path/]
  84. // TESTRESPONSE[s/"rest_actions": [^}]+}/"rest_actions": $body.$_path/]
  85. // TESTRESPONSE[s/"aggregations": [^}]+}/"aggregations": $body.$_path/]
  86. <1> Timestamp for when this nodes usage request was performed.
  87. <2> Timestamp for when the usage information recording was started. This is
  88. equivalent to the time that the node was started.
  89. <3> Search action has been called 19 times for this node.