Skip to content

Commit

Permalink
Replace discovered_master with discovered_cluster_manager in cat heal…
Browse files Browse the repository at this point in the history
…th api

Signed-off-by: Tianli Feng <ftianli@amazon.com>
  • Loading branch information
Tianli Feng committed Mar 11, 2022
1 parent b00b3ce commit c6ba67d
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,89 +1,148 @@
---
"Help":
- skip:
version: " - 7.10.99"
reason: "discovered_master added in OpenSearch 1.0.0"
version: " - 7.10.99 , 2.0.0 - "
reason: "discovered_master added in OpenSearch 1.0.0"
- do:
cat.health:
help: true

- match:
$body: |
/^ epoch .+ \n
timestamp .+ \n
cluster .+ \n
status .+ \n
node.total .+ \n
node.data .+ \n
discovered_master .+ \n
shards .+ \n
pri .+ \n
relo .+ \n
init .+ \n
unassign .+ \n
pending_tasks .+ \n
max_task_wait_time .+ \n
active_shards_percent .+ \n
$/
/^ epoch .+ \n
timestamp .+ \n
cluster .+ \n
status .+ \n
node.total .+ \n
node.data .+ \n
discovered_master .+ \n
shards .+ \n
pri .+ \n
relo .+ \n
init .+ \n
unassign .+ \n
pending_tasks .+ \n
max_task_wait_time .+ \n
active_shards_percent .+ \n
$/
---
"Empty cluster":
- skip:
version: " - 7.10.99"
version: " - 7.10.99 , 2.0.0 - "
reason: "discovered_master added in OpenSearch 1.0.0"
- do:
cat.health: {}

- match:
$body: |
/^
( \d+ \s+ # epoch
\d\d:\d\d:\d\d \s+ # timestamp
\S+ \s+ # cluster
\w+ \s+ # status
\d+ \s+ # node.total
\d+ \s+ # node.data
\w+ \s+ # discovered_master
\d+ \s+ # shards
\d+ \s+ # pri
\d+ \s+ # relo
\d+ \s+ # init
\d+ \s+ # unassign
\d+ \s+ # pending_tasks
(-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time
\d+\.\d+% # active shards percent
\n
)+
$/
/^
( \d+ \s+ # epoch
\d\d:\d\d:\d\d \s+ # timestamp
\S+ \s+ # cluster
\w+ \s+ # status
\d+ \s+ # node.total
\d+ \s+ # node.data
\w+ \s+ # discovered_master
\d+ \s+ # shards
\d+ \s+ # pri
\d+ \s+ # relo
\d+ \s+ # init
\d+ \s+ # unassign
\d+ \s+ # pending_tasks
(-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time
\d+\.\d+% # active shards percent
\n
)+
$/
---
"Help - after 2.0.0":
- skip:
version: " - 1.4.99"
reason: "discovered_cluster_manager replaced the old terminology in 2.0.0"
- do:
cat.health:
help: true

- match:
$body: |
/^ epoch .+ \n
timestamp .+ \n
cluster .+ \n
status .+ \n
node.total .+ \n
node.data .+ \n
discovered_cluster_manager .+ \n
shards .+ \n
pri .+ \n
relo .+ \n
init .+ \n
unassign .+ \n
pending_tasks .+ \n
max_task_wait_time .+ \n
active_shards_percent .+ \n
$/
---
"Empty cluster - after 2.0.0":
- skip:
version: " - 1.4.99"
reason: "discovered_cluster_manager replaced the old terminology in 2.0.0"
- do:
cat.health: {}

- match:
$body: |
/^
( \d+ \s+ # epoch
\d\d:\d\d:\d\d \s+ # timestamp
\S+ \s+ # cluster
\w+ \s+ # status
\d+ \s+ # node.total
\d+ \s+ # node.data
\w+ \s+ # discovered_cluster_manager
\d+ \s+ # shards
\d+ \s+ # pri
\d+ \s+ # relo
\d+ \s+ # init
\d+ \s+ # unassign
\d+ \s+ # pending_tasks
(-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time
\d+\.\d+% # active shards percent
\n
)+
$/
---
"With ts parameter":
- skip:
version: " - 7.10.99"
reason: "discovered_master added in OpenSearch 1.0.0"
version: " - 1.4.99"
reason: "discovered_cluster_manager replaced the old terminology in 2.0.0"
- do:
cat.health:
ts: false

- match:
$body: |
/^
( \S+ \s+ # cluster
\w+ \s+ # status
\d+ \s+ # node.total
\d+ \s+ # node.data
\w+ \s+ # discovered_master
\d+ \s+ # shards
\d+ \s+ # pri
\d+ \s+ # relo
\d+ \s+ # init
\d+ \s+ # unassign
\d+ \s+ # pending_tasks
(-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time
\d+\.\d+% # active shards percent
\n
)+
$/
/^
( \S+ \s+ # cluster
\w+ \s+ # status
\d+ \s+ # node.total
\d+ \s+ # node.data
\w+ \s+ # discovered_cluster_manager
\d+ \s+ # shards
\d+ \s+ # pri
\d+ \s+ # relo
\d+ \s+ # init
\d+ \s+ # unassign
\d+ \s+ # pending_tasks
(-|\d+(?:[.]\d+)?m?s) \s+ # max task waiting time
\d+\.\d+% # active shards percent
\n
)+
$/
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ protected Table getTableWithHeader(final RestRequest request) {
t.addCell("status", "alias:st;desc:health status");
t.addCell("node.total", "alias:nt,nodeTotal;text-align:right;desc:total number of nodes");
t.addCell("node.data", "alias:nd,nodeData;text-align:right;desc:number of nodes that can store data");
t.addCell("discovered_master", "alias:dm;text-align:right;desc:discovered master");
t.addCell("discovered_cluster_manager", "alias:dm;text-align:right;desc:cluster manager is discovered or not");
t.addCell("shards", "alias:t,sh,shards.total,shardsTotal;text-align:right;desc:total number of shards");
t.addCell("pri", "alias:p,shards.primary,shardsPrimary;text-align:right;desc:number of primary shards");
t.addCell("relo", "alias:r,shards.relocating,shardsRelocating;text-align:right;desc:number of relocating nodes");
Expand Down

0 comments on commit c6ba67d

Please sign in to comment.