How to get only following response from the nodes API REST service GET /_nodes/
{
"_nodes": {
"total": 2,
"successful": 2,
"failed": 0
}
}
How to get only following response from the nodes API REST service GET /_nodes/
{
"_nodes": {
"total": 2,
"successful": 2,
"failed": 0
}
}
You cannot.
What are you trying to do?
Trying to get the total number of nodes in a cluster to see if all of the nodes are available and none of them are down.
The closest you can get it is
[
{
"name": "node_name",
"ram.percent": "58"
}
]
by accessing http://localhost:9200/_cat/nodes?h=name,ram.percent&format=json
You can always get the cluster details which will contain the number of nodes by accessing http://localhost:9200/_cluster/health
{
"cluster_name" : "testcluster",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 1,
"number_of_data_nodes" : 1,
"active_primary_shards" : 5,
"active_shards" : 5,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 5,
"delayed_unassigned_shards": 0,
"number_of_pending_tasks" : 0,
"number_of_in_flight_fetch": 0,
"task_max_waiting_in_queue_millis": 0,
"active_shards_percent_as_number": 50.0
}
Thanks.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.