2017-06-02 03:46:38 -04:00
|
|
|
[[cluster-nodes-usage]]
|
2019-10-22 13:27:31 -04:00
|
|
|
=== Nodes feature usage API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Nodes feature usage</titleabbrev>
|
|
|
|
++++
|
2017-06-02 03:46:38 -04:00
|
|
|
|
2019-08-14 12:19:05 -04:00
|
|
|
Returns information on the usage of features.
|
2017-06-02 03:46:38 -04:00
|
|
|
|
2019-08-14 12:19:05 -04:00
|
|
|
|
|
|
|
[[cluster-nodes-usage-api-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`GET /_nodes/usage` +
|
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`GET /_nodes/<node_id>/usage` +
|
2019-08-14 12:19:05 -04:00
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`GET /_nodes/usage/<metric>` +
|
2019-08-14 12:19:05 -04:00
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`GET /_nodes/<node_id>/usage/<metric>`
|
2019-08-14 12:19:05 -04:00
|
|
|
|
|
|
|
|
|
|
|
[[cluster-nodes-usage-api-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
The cluster nodes usage API allows you to retrieve information on the usage
|
|
|
|
of features for each node. All the nodes selective options are explained
|
|
|
|
<<cluster-nodes,here>>.
|
|
|
|
|
|
|
|
|
|
|
|
[[cluster-nodes-usage-api-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
|
|
|
|
2019-08-23 10:57:20 -04:00
|
|
|
`<metric>`::
|
2019-08-14 12:19:05 -04:00
|
|
|
(Optional, string) Limits the information returned to the specific metrics.
|
|
|
|
A comma-separated list of the following options:
|
|
|
|
+
|
|
|
|
--
|
|
|
|
`_all`::
|
|
|
|
Returns all stats.
|
|
|
|
|
|
|
|
`rest_actions`::
|
|
|
|
Returns the REST actions classname with a count of the number of times
|
|
|
|
that action has been called on the node.
|
|
|
|
--
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=node-id]
|
|
|
|
|
|
|
|
|
|
|
|
[[cluster-nodes-usage-api-query-params]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|
|
|
|
|
|
|
|
|
|
|
[[cluster-nodes-usage-api-example]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
|
|
|
Rest action example:
|
2017-06-02 03:46:38 -04:00
|
|
|
|
2019-09-09 13:38:14 -04:00
|
|
|
[source,console]
|
2017-06-02 03:46:38 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
GET _nodes/usage
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:node]
|
|
|
|
|
2019-08-14 12:19:05 -04:00
|
|
|
The API returns the following response:
|
2017-06-02 03:46:38 -04:00
|
|
|
|
2019-09-06 16:09:09 -04:00
|
|
|
[source,console-result]
|
2017-06-02 03:46:38 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"_nodes": {
|
|
|
|
"total": 1,
|
|
|
|
"successful": 1,
|
|
|
|
"failed": 0
|
|
|
|
},
|
|
|
|
"cluster_name": "my_cluster",
|
|
|
|
"nodes": {
|
|
|
|
"pQHNt5rXTTWNvUgOrdynKg": {
|
|
|
|
"timestamp": 1492553961812, <1>
|
|
|
|
"since": 1492553906606, <2>
|
|
|
|
"rest_actions": {
|
|
|
|
"org.elasticsearch.rest.action.admin.cluster.RestNodesUsageAction": 1,
|
|
|
|
"org.elasticsearch.rest.action.admin.indices.RestCreateIndexAction": 1,
|
|
|
|
"org.elasticsearch.rest.action.document.RestGetAction": 1,
|
|
|
|
"org.elasticsearch.rest.action.search.RestSearchAction": 19, <3>
|
|
|
|
"org.elasticsearch.rest.action.admin.cluster.RestNodesInfoAction": 36
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TESTRESPONSE[s/"my_cluster"/$body.cluster_name/]
|
|
|
|
// TESTRESPONSE[s/"pQHNt5rXTTWNvUgOrdynKg"/\$node_name/]
|
|
|
|
// TESTRESPONSE[s/1492553961812/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/1492553906606/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/"rest_actions": [^}]+}/"rest_actions": $body.$_path/]
|
|
|
|
<1> Timestamp for when this nodes usage request was performed.
|
2017-12-01 10:54:30 -05:00
|
|
|
<2> Timestamp for when the usage information recording was started. This is
|
2017-06-02 03:46:38 -04:00
|
|
|
equivalent to the time that the node was started.
|
2019-08-14 12:19:05 -04:00
|
|
|
<3> Search action has been called 19 times for this node.
|