From 5feaa484b5e86187c7b6b45486e3815fe9559767 Mon Sep 17 00:00:00 2001 From: Leonardo Menezes Date: Tue, 24 Mar 2015 23:51:09 +0100 Subject: [PATCH] Cat api: added node id column to _cat/plugins response relates to #10226 --- rest-api-spec/test/cat.plugins/10_basic.yaml | 16 ++++++++++++++++ .../rest/action/cat/RestPluginsAction.java | 2 ++ .../rest/action/cat/RestSegmentsAction.java | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 rest-api-spec/test/cat.plugins/10_basic.yaml diff --git a/rest-api-spec/test/cat.plugins/10_basic.yaml b/rest-api-spec/test/cat.plugins/10_basic.yaml new file mode 100644 index 00000000000..bf974c85703 --- /dev/null +++ b/rest-api-spec/test/cat.plugins/10_basic.yaml @@ -0,0 +1,16 @@ +--- +"Help": + - do: + cat.plugins: + help: true + + - match: + $body: | + /^ id .+ \n + name .+ \n + component .+ \n + version .+ \n + type .+ \n + url .+ \n + description .+ \n + $/ diff --git a/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java b/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java index d104328fe74..3d0dda320e1 100644 --- a/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java +++ b/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java @@ -77,6 +77,7 @@ public class RestPluginsAction extends AbstractCatAction { Table getTableWithHeader(final RestRequest request) { Table table = new Table(); table.startHeaders(); + table.addCell("id", "default:false;desc:unique node id"); table.addCell("name", "alias:n;desc:node name"); table.addCell("component", "alias:c;desc:component"); table.addCell("version", "alias:v;desc:component version"); @@ -96,6 +97,7 @@ public class RestPluginsAction extends AbstractCatAction { for (PluginInfo pluginInfo : info.getPlugins().getInfos()) { table.startRow(); + table.addCell(node.id()); table.addCell(node.name()); table.addCell(pluginInfo.getName()); table.addCell(pluginInfo.getVersion()); diff --git a/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java b/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java index 5c6a3e3bf1b..0a9c02f4fd7 100644 --- a/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java +++ b/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java @@ -88,7 +88,7 @@ public class RestSegmentsAction extends AbstractCatAction { table.addCell("shard", "default:true;alias:s,sh;desc:shard name"); table.addCell("prirep", "alias:p,pr,primaryOrReplica;default:true;desc:primary or replica"); table.addCell("ip", "default:true;desc:ip of node where it lives"); - table.addCell("id", "default:false;desc:unique id node where it lives"); + table.addCell("id", "default:false;desc:unique id of node where it lives"); table.addCell("segment", "default:true;alias:seg;desc:segment name"); table.addCell("generation", "default:true;alias:g,gen;text-align:right;desc:segment generation"); table.addCell("docs.count", "default:true;alias:dc,docsCount;text-align:right;desc:number of docs in segment");