# Nodes API

**URL:** <https://discuss.elastic.co/t/nodes-api/99831>\
**Category:** Elasticsearch\
**Created:** [September 8, 2017, 10:28am UTC](https://discuss.elastic.co/t/nodes-api/99831 "2017-09-08T10:28:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [September 8, 2017, 10:28am UTC](https://discuss.elastic.co/t/nodes-api/99831/1 "2017-09-08T10:28:58Z")

</div>

How to get only following response from the nodes API REST service GET /\_nodes/

{  
"\_nodes": {  
"total": 2,  
"successful": 2,  
"failed": 0  
}  
}

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 8, 2017, 10:31am UTC](https://discuss.elastic.co/t/nodes-api/99831/2 "2017-09-08T10:31:12Z")

</div>

You cannot.  
What are you trying to do?

---

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [September 8, 2017, 10:50am UTC](https://discuss.elastic.co/t/nodes-api/99831/3 "2017-09-08T10:50:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![vishnugt](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vishnugt/32/22026_2.png) [@vishnugt](https://discuss.elastic.co/u/vishnugt)\
**Post date:** [September 8, 2017, 11:46am UTC](https://discuss.elastic.co/t/nodes-api/99831/4 "2017-09-08T11:46:08Z")

</div>

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](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](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
}
```

---

<div class="post-metadata">

**Author:** ![mruthyu](https://avatars.discourse-cdn.com/v4/letter/m/bb73d2/32.png) [@mruthyu](https://discuss.elastic.co/u/mruthyu)\
**Post date:** [September 12, 2017, 1:11pm UTC](https://discuss.elastic.co/t/nodes-api/99831/5 "2017-09-12T13:11:43Z")

</div>

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 10, 2017, 1:11pm UTC](https://discuss.elastic.co/t/nodes-api/99831/6 "2017-10-10T13:11:52Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
