91 lines
2.3 KiB
Markdown
91 lines
2.3 KiB
Markdown
---
|
|
layout: default
|
|
title: CAT node attributes
|
|
parent: CAT APIs
|
|
nav_order: 35
|
|
has_children: false
|
|
redirect_from:
|
|
- /opensearch/rest-api/cat/cat-nodeattrs/
|
|
---
|
|
|
|
# CAT Node Attributes API
|
|
**Introduced 1.0**
|
|
{: .label .label-purple }
|
|
|
|
The CAT node attributes operation lists the attributes of custom nodes.
|
|
|
|
|
|
<!-- spec_insert_start
|
|
api: cat.nodeattrs
|
|
component: endpoints
|
|
-->
|
|
## Endpoints
|
|
```json
|
|
GET /_cat/nodeattrs
|
|
```
|
|
<!-- spec_insert_end -->
|
|
|
|
|
|
<!-- spec_insert_start
|
|
api: cat.nodeattrs
|
|
component: query_parameters
|
|
columns: Parameter, Data type, Description, Default
|
|
include_deprecated: false
|
|
-->
|
|
## Query parameters
|
|
|
|
The following table lists the available query parameters. All query parameters are optional.
|
|
|
|
| Parameter | Data type | Description | Default |
|
|
| :--- | :--- | :--- | :--- |
|
|
| `cluster_manager_timeout` | String | The amount of time allowed to establish a connection to the cluster manager node. | N/A |
|
|
| `format` | String | A short version of the `Accept` header, such as `json` or `yaml`. <br> Valid values are: `cbor`, `json`, `smile`, `text`, and `yaml`. | `text` |
|
|
| `h` | List | A comma-separated list of column names to display. | N/A |
|
|
| `help` | Boolean | Returns help information. | `false` |
|
|
| `limit` | Integer | The maximum number of rows to return. Must be greater than 0. Applied after sorting (`s`). | N/A |
|
|
| `local` | Boolean | Returns local information but does not retrieve the state from the cluster manager node. | `false` |
|
|
| `s` | List | A comma-separated list of column names or column aliases to sort by. | N/A |
|
|
| `v` | Boolean | Enables verbose mode, which displays column headers. | `false` |
|
|
|
|
<!-- spec_insert_end -->
|
|
|
|
## Example request
|
|
|
|
The following example request returns attributes about custom nodes:
|
|
|
|
<!-- spec_insert_start
|
|
component: example_code
|
|
rest: GET /_cat/nodeattrs?v
|
|
body:
|
|
-->
|
|
{% capture step1_rest %}
|
|
GET /_cat/nodeattrs?v
|
|
|
|
{% endcapture %}
|
|
|
|
{% capture step1_python %}
|
|
|
|
|
|
response = client.cat.nodeattrs(
|
|
params = { "v": "true" }
|
|
)
|
|
|
|
{% endcapture %}
|
|
|
|
{% include code-block.html
|
|
rest=step1_rest
|
|
python=step1_python %}
|
|
<!-- spec_insert_end -->
|
|
|
|
|
|
## Example response
|
|
|
|
```json
|
|
node | host | ip | attr | value
|
|
odfe-node2 | 172.18.0.3 | 172.18.0.3 | testattr | test
|
|
```
|
|
|
|
## Required permissions
|
|
|
|
If you use the Security plugin, make sure you have the appropriate permissions: `cluster:monitor/nodes/info`.
|