Remove host from cat nodes API

As the host and ip fields are always equal by design, the host field in
the cat nodes API is redundant and should be removed.

Closes #16656
This commit is contained in:
Jason Tedor 2016-02-13 22:49:23 -05:00
parent 3f7693fdc2
commit 3bbd1c129e
4 changed files with 10 additions and 7 deletions

View File

@ -115,7 +115,6 @@ public class RestNodesAction extends AbstractCatAction {
table.startHeaders(); table.startHeaders();
table.addCell("id", "default:false;alias:id,nodeId;desc:unique node id"); table.addCell("id", "default:false;alias:id,nodeId;desc:unique node id");
table.addCell("pid", "default:false;alias:p;desc:process id"); table.addCell("pid", "default:false;alias:p;desc:process id");
table.addCell("host", "alias:h;desc:host name");
table.addCell("ip", "alias:i;desc:ip address"); table.addCell("ip", "alias:i;desc:ip address");
table.addCell("port", "default:false;alias:po;desc:bound transport port"); table.addCell("port", "default:false;alias:po;desc:bound transport port");
@ -242,7 +241,6 @@ public class RestNodesAction extends AbstractCatAction {
table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4)); table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4));
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(info == null ? null : info.getProcess().getId());
table.addCell(node.getHostName());
table.addCell(node.getHostAddress()); table.addCell(node.getHostAddress());
if (node.address() instanceof InetSocketTransportAddress) { if (node.address() instanceof InetSocketTransportAddress) {
table.addCell(((InetSocketTransportAddress) node.address()).address().getPort()); table.addCell(((InetSocketTransportAddress) node.address()).address().getPort());

View File

@ -83,7 +83,6 @@ k0zy 192.168.56.10 9300 {version} m
|Header |Alias |Appear by Default |Description |Example |Header |Alias |Appear by Default |Description |Example
|`id` |`nodeId` |No |Unique node ID |k0zy |`id` |`nodeId` |No |Unique node ID |k0zy
|`pid` |`p` |No |Process ID |13061 |`pid` |`p` |No |Process ID |13061
|`host` |`h` |Yes |Host name |n1
|`ip` |`i` |Yes |IP address |127.0.1.1 |`ip` |`i` |Yes |IP address |127.0.1.1
|`port` |`po` |No |Bound transport port |9300 |`port` |`po` |No |Bound transport port |9300
|`version` |`v` |No |Elasticsearch version |{version} |`version` |`v` |No |Elasticsearch version |{version}

View File

@ -173,6 +173,12 @@ header field for this purpose. Elasticsearch now uses the Accept header
field and support for using the Content-Type header field for this field and support for using the Content-Type header field for this
purpose has been removed. purpose has been removed.
==== Host field removed from the cat nodes API
The `host` field has been removed from the cat nodes API as its value
is always equal to the `ip` field. The `name` field is available in the
cat nodes API and should be used instead of the `host` field.
[[breaking_30_parent_child_changes]] [[breaking_30_parent_child_changes]]
=== Parent/Child changes === Parent/Child changes

View File

@ -6,8 +6,8 @@
- match: - match:
$body: | $body: |
/ #host ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name / #ip heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
^ (\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ [-dc] \s+ [-*mx] \s+ (\S+\s?)+ \n)+ $/ ^ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ [-dc] \s+ [-*mx] \s+ (\S+\s?)+ \n)+ $/
- do: - do:
cat.nodes: cat.nodes:
@ -15,8 +15,8 @@
- match: - match:
$body: | $body: |
/^ host \s+ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n /^ ip \s+ heap\.percent \s+ ram\.percent \s+ cpu \s+ load_1m \s+ load_5m \s+ load_15m \s+ node\.role \s+ master \s+ name \n
(\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ [-dc] \s+ [-*mx] \s+ (\S+\s?)+ \n)+ $/ ((\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d* \s+ (-)?\d* \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ ((-)?\d*(\.\d+)?)? \s+ [-dc] \s+ [-*mx] \s+ (\S+\s?)+ \n)+ $/
- do: - do:
cat.nodes: cat.nodes: