mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
parent
87a4995bed
commit
737db98bd7
@ -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"
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: bar
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: baz
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
cat.indices:
|
||||
index: f*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(foo \n?)$/
|
||||
|
||||
- do:
|
||||
cat.indices:
|
||||
index: ba*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(ba(r|z) \n?){2}$/
|
||||
|
@ -114,3 +114,71 @@
|
||||
catch: forbidden
|
||||
cat.segments:
|
||||
index: index1
|
||||
|
||||
---
|
||||
"Test cat segments using wildcards":
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: foo
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: foo
|
||||
type: type
|
||||
body: { test: foo }
|
||||
refresh: true
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: bar
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: bar
|
||||
type: type
|
||||
body: { test: bar }
|
||||
refresh: true
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: baz
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
index:
|
||||
index: baz
|
||||
type: type
|
||||
body: { test: baz }
|
||||
refresh: true
|
||||
|
||||
- do:
|
||||
cat.segments:
|
||||
index: f*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(foo \n?)$/
|
||||
|
||||
- do:
|
||||
cat.segments:
|
||||
index: ba*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(ba(r|z) \n?){2}$/
|
||||
|
@ -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":
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: foo
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: bar
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: baz
|
||||
body:
|
||||
settings:
|
||||
number_of_shards: "1"
|
||||
number_of_replicas: "0"
|
||||
|
||||
- do:
|
||||
cat.shards:
|
||||
index: f*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(foo \n?)$/
|
||||
|
||||
- do:
|
||||
cat.shards:
|
||||
index: ba*
|
||||
v: false
|
||||
h: i
|
||||
|
||||
- match:
|
||||
$body: |
|
||||
/^(ba(r|z) \n?){2}$/
|
||||
|
Loading…
x
Reference in New Issue
Block a user