closes #19634
@@ -73,6 +73,7 @@ public class RestShardsAction extends AbstractCatAction {
public void processResponse(final ClusterStateResponse clusterStateResponse) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.all();
+ indicesStatsRequest.indices(indices);
client.admin().indices().stats(indicesStatsRequest, new RestResponseListener<IndicesStatsResponse>(channel) {
@Override
public RestResponse buildResponse(IndicesStatsResponse indicesStatsResponse) throws Exception {
@@ -25,7 +25,7 @@ some bandwidth by supplying an index pattern to the end.
[source,sh]
--------------------------------------------------
-% curl 192.168.56.20:9200/_cat/shards/wiki2
+% curl 192.168.56.20:9200/_cat/shards/wiki*
wiki2 0 p STARTED 197 3.2mb 192.168.56.10 Stiletto
wiki2 1 p STARTED 205 5.9mb 192.168.56.30 Frankie Raye
wiki2 2 p STARTED 275 7.8mb 192.168.56.20 Commander Kraken
@@ -69,3 +69,50 @@
\s*
)
$/
+
+---
+"Test cat indices using wildcards":
+ - do:
+ indices.create:
+ index: foo
+ body:
+ settings:
+ number_of_shards: "1"
+ number_of_replicas: "0"
+ index: bar
+ index: baz
+ cat.indices:
+ index: f*
+ v: false
+ h: i
+ - match:
+ $body: |
+ /^(foo \n?)$/
+ index: ba*
+ /^(ba(r|z) \n?){2}$/
@@ -114,3 +114,71 @@
catch: forbidden
cat.segments:
index: index1
+"Test cat segments using wildcards":
+ index:
+ type: type
+ body: { test: foo }
+ refresh: true
+ body: { test: bar }
+ body: { test: baz }
+ cat.segments:
@@ -189,3 +189,50 @@
- match:
$body: |
/^(index3 \s+ \d \s+ (p|s) \s+ ((STARTED|INITIALIZING|RELOCATING) \s+ (\d \s+ (\d+|\d+[.]\d+)(kb|b) \s+)? \d{1,3}.\d{1,3}.\d{1,3}.\d{1,3} \s+ .+|UNASSIGNED \s+) \n?){2}$/
+"Test cat shards using wildcards":
+ cat.shards: