1
1
[[cat-nodeattrs]]
2
2
=== cat nodeattrs
3
3
4
- The `nodeattrs` command shows custom node attributes.
5
- For example:
4
+ Returns information about custom node attributes.
5
+
6
+ [[cat-nodeattrs-api-request]]
7
+ ==== {api-request-title}
8
+
9
+ `GET /_cat/nodeattrs`
10
+
11
+ [[cat-nodeattrs-api-query-params]]
12
+ ==== {api-query-parms-title}
13
+
14
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=http-format]
15
+
16
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-h]
17
+ +
18
+ --
19
+ If you do not specify which columns to include, the API returns the default columns in the order listed below. If you explicitly specify one or more columns, it only returns the specified columns.
20
+
21
+ Valid columns are:
22
+
23
+ `node`,`name`::
24
+ (Default) Name of the node, such as `DKDM97B`.
25
+
26
+ `host`, `h`::
27
+ (Default) Host name, such as `n1`.
28
+
29
+ `ip`, `i`::
30
+ (Default) IP address, such as `127.0.1.1`.
31
+
32
+ `attr`, `attr.name`::
33
+ (Default) Attribute name, such as `rack`.
34
+
35
+ `value`, `attr.value`::
36
+ (Default) Attribute value, such as `rack123`.
37
+
38
+ `id`, `nodeId`::
39
+ ID of the node, such as `k0zy`.
40
+
41
+ `pid`, `p`::
42
+ Process ID, such as `13061`.
43
+
44
+ `port`, `po`::
45
+ Bound transport port, such as `9300`.
46
+ --
47
+
48
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=help]
49
+
50
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=local]
51
+
52
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
53
+
54
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-s]
55
+
56
+ include::{docdir}/rest-api/common-parms.asciidoc[tag=cat-v]
57
+
58
+
59
+ [[cat-nodeattrs-api-example]]
60
+ ==== {api-examples-title}
61
+
62
+ [[cat-nodeattrs-api-ex-default]]
63
+ ===== Example with default columns
6
64
7
65
[source,js]
8
66
--------------------------------------------------
@@ -12,7 +70,7 @@ GET /_cat/nodeattrs?v
12
70
// TEST[s/\?v/\?v&s=node,attr/]
13
71
// Sort the resulting attributes so we can assert on them more easily
14
72
15
- Could look like :
73
+ The API returns the following response :
16
74
17
75
[source,txt]
18
76
--------------------------------------------------
@@ -27,27 +85,14 @@ node-0 127.0.0.1 127.0.0.1 testattr test
27
85
// If xpack is installed then the first ... contains ml attributes
28
86
// and the second contains xpack.installed=true
29
87
30
- The first few columns (`node`, `host`, `ip`) give you basic info per node
31
- and the `attr` and `value` columns give you the custom node attributes,
32
- one per line.
33
-
34
- [float]
35
- ==== Columns
88
+ The `node`, `host`, and `ip` columns provide basic information about each node.
89
+ The `attr` and `value` columns return custom node attributes, one per line.
36
90
37
- Below is an exhaustive list of the existing headers that can be
38
- passed to `nodeattrs?h=` to retrieve the relevant details in ordered
39
- columns. If no headers are specified, then those marked to Appear
40
- by Default will appear. If any header is specified, then the defaults
41
- are not used.
91
+ [[cat-nodeattrs-api-ex-headings]]
92
+ ===== Example with explicit columns
42
93
43
- Aliases can be used in place of the full header name for brevity.
44
- Columns appear in the order that they are listed below unless a
45
- different order is specified (e.g., `h=attr,value` versus `h=value,attr`).
46
-
47
- When specifying headers, the headers are not placed in the output
48
- by default. To have the headers appear in the output, use verbose
49
- mode (`v`). The header name will match the supplied value (e.g.,
50
- `pid` versus `p`). For example:
94
+ The following API request returns the `name`, `pid`, `attr`, and `value`
95
+ columns.
51
96
52
97
[source,js]
53
98
--------------------------------------------------
@@ -57,7 +102,7 @@ GET /_cat/nodeattrs?v&h=name,pid,attr,value
57
102
// TEST[s/,value/,value&s=node,attr/]
58
103
// Sort the resulting attributes so we can assert on them more easily
59
104
60
- Might look like :
105
+ The API returns the following response :
61
106
62
107
[source,txt]
63
108
--------------------------------------------------
@@ -71,17 +116,4 @@ node-0 19566 testattr test
71
116
// TESTRESPONSE[s/\.\.\.\n/(.+ ml\\..+\n)*/ non_json]
72
117
// If xpack is not installed then neither ... with match anything
73
118
// If xpack is installed then the first ... contains ml attributes
74
- // and the second contains xpack.installed=true
75
-
76
- [cols="<,<,<,<,<",options="header",subs="normal"]
77
- |=======================================================================
78
- |Header |Alias |Appear by Default |Description |Example
79
- |`node`|`name`|Yes|Name of the node|DKDM97B
80
- |`id` |`nodeId` |No |Unique node ID |k0zy
81
- |`pid` |`p` |No |Process ID |13061
82
- |`host` |`h` |Yes |Host name |n1
83
- |`ip` |`i` |Yes |IP address |127.0.1.1
84
- |`port` |`po` |No |Bound transport port |9300
85
- |`attr` | `attr.name` | Yes | Attribute name | rack
86
- |`value` | `attr.value` | Yes | Attribute value | rack123
87
- |=======================================================================
119
+ // and the second contains xpack.installed=true
0 commit comments