From e34a35244cac6981b03d8c0a7f05e8a2f2942c55 Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Mon, 20 Jan 2014 09:23:00 +0100 Subject: [PATCH] [DOCS] Added documentation for CAT Aliases API Added asciidoc. Added new lines in java class. --- docs/reference/cat.asciidoc | 2 ++ docs/reference/cat/alias.asciidoc | 22 +++++++++++++++++++ .../rest/action/cat/RestAliasAction.java | 8 +++---- 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 docs/reference/cat/alias.asciidoc diff --git a/docs/reference/cat.asciidoc b/docs/reference/cat.asciidoc index 4525db23dd8..d53b7236231 100644 --- a/docs/reference/cat.asciidoc +++ b/docs/reference/cat.asciidoc @@ -94,6 +94,8 @@ green foo 1 0 227 0 2065131 2065131 -- +include::cat/alias.asciidoc[] + include::cat/allocation.asciidoc[] include::cat/count.asciidoc[] diff --git a/docs/reference/cat/alias.asciidoc b/docs/reference/cat/alias.asciidoc new file mode 100644 index 00000000000..301a9f8d7dc --- /dev/null +++ b/docs/reference/cat/alias.asciidoc @@ -0,0 +1,22 @@ +[[cat-alias]] +== Aliases + +`aliases` shows information about currently configured aliases to indices +including filter and routing infos. + +[source,shell] +-------------------------------------------------- +% curl '192.168.56.10:9200/_cat/aliases?v' +alias index filter indexRouting searchRouting +alias2 test1 * - - +alias4 test1 - 2 1,2 +alias1 test1 - - - +alias3 test1 - 1 1 +-------------------------------------------------- + +The output shows that `alias` has configured a filter, and specific routing +configurations in `alias3` and `alias4`. + +If you only want to get information about a single alias, you can specify +the alias in the URL, for example `/_cat/aliases/alias1`. + diff --git a/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java b/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java index df12de17219..117df3ad96e 100644 --- a/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java +++ b/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java @@ -82,8 +82,8 @@ public class RestAliasAction extends AbstractCatAction { @Override void documentation(StringBuilder sb) { - sb.append("/_cat/aliases"); - sb.append("/_cat/aliases/{alias}"); + sb.append("/_cat/aliases\n"); + sb.append("/_cat/aliases/{alias}\n"); } @Override @@ -93,8 +93,8 @@ public class RestAliasAction extends AbstractCatAction { table.addCell("alias", "desc:alias name"); table.addCell("index", "desc:index alias points to"); table.addCell("filter", "desc:filter"); - table.addCell("index_routing", "desc:index routing"); - table.addCell("search_routing", "desc:search routing"); + table.addCell("indexRouting", "desc:index routing"); + table.addCell("searchRouting", "desc:search routing"); table.endHeaders(); return table; }