2022-04-22 12:39:12 -04:00
---
layout: default
2022-05-19 11:23:12 -04:00
title: Nodes API
2022-04-22 12:39:12 -04:00
parent: REST API reference
has_children: true
nav_order: 5
---
2022-05-19 11:23:12 -04:00
# Nodes API
2022-04-22 12:39:12 -04:00
2022-05-18 11:34:34 -04:00
The nodes API makes it possible to retrieve information about individual nodes within your cluster. It supports standard parameters such `{timeout}` and `{node-filters}` .
2022-04-22 12:39:12 -04:00
## Timeout
The `{timeout}` parameter can be used to change the default time limit for node response.
Parameter | Type | Description
:--- |:----------| :---
`{timeout}` | TimeValue | Default value is `30s` .
## Node filters
2022-05-18 11:34:34 -04:00
Use the `{node-filters}` parameter to filter the target set of nodes in the API response.
2022-04-22 12:39:12 -04:00
Parameter | Type | Description
:--- |:-------| :---
2022-05-18 11:34:34 -04:00
{node-filters} | String | A comma-separated list of resolution mechanisms that OpenSearch uses to identify cluster nodes.
2022-04-22 12:39:12 -04:00
2022-05-19 11:23:12 -04:00
Node filters support several node resolution mechanisms.
2022-04-22 12:39:12 -04:00
2022-05-19 11:23:12 -04:00
- Pre defined constants: `_local` , `_cluster_manager` , or `_all`
- An exact match for `nodeID`
2022-05-18 11:34:34 -04:00
- A simple case-sensitive wildcard pattern matching for `node-name` , `host-name` , or `host-IP-address`
- Node roles where the `<bool>` value is set either to `true` or `false` ):
- `cluster_manager:<bool>`
2022-04-22 12:39:12 -04:00
- `data:<bool>`
- `ingest:<bool>`
- `voting_only:<bool>`
- `ml:<bool>`
- `coordinating_only:<bool>`
2022-05-18 11:34:34 -04:00
- A simple case-sensitive wildcard pattern matching for node attributes: `<node attribute*>:<attribute value*>` . The wildcard matching pattern can be used in both the key and value at the same time.
2022-04-22 12:39:12 -04:00
2022-05-18 11:34:34 -04:00
Resolution mechanisms are applied sequentially in the order specified by the client. Each mechanism specification can either add or remove nodes.
2022-04-22 12:39:12 -04:00
2022-05-19 11:23:12 -04:00
If you want to get statistics from the elected cluster manager node only, use the following:
2022-04-22 12:39:12 -04:00
2022-05-18 11:34:34 -04:00
```bash
2022-04-22 12:39:12 -04:00
GET /_nodes/_cluster_manager/stats
```
2022-05-19 11:23:12 -04:00
If you want to get statistics from nodes that are data-only nodes, use the following:
2022-05-18 11:34:34 -04:00
```bash
2022-04-22 12:39:12 -04:00
GET /_nodes/data:true/stats
```
2022-05-18 11:34:34 -04:00
### Order of resolution mechanisms
2022-04-22 12:39:12 -04:00
2022-05-18 13:54:11 -04:00
The order of resolution mechanisms is applied sequentially, and each can add or remove nodes. The following examples yield different results:
2022-05-18 11:34:34 -04:00
2022-05-19 11:23:12 -04:00
If you want to get statistics from all the nodes but the cluster manager node, use the following:
2022-05-18 11:34:34 -04:00
```bash
2022-05-18 13:54:11 -04:00
GET /_nodes/_all,cluster_manager:false/stats
2022-04-22 12:39:12 -04:00
```
2022-05-18 11:34:34 -04:00
However, if we switch the resolution mechanisms, then the result will include all the cluster nodes including the cluster manager node.
```bash
2022-04-22 12:39:12 -04:00
GET /_nodes/cluster_namager:false,_all/stats
```