From a0c43a3f8502e9d3c14deaa2b5915152d8715b40 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 2 Mar 2022 21:34:31 -0800 Subject: [PATCH 01/12] Add _cat cluster_manager as the ReplacedRoute for _cat master rest api Signed-off-by: Tianli Feng --- .../org/opensearch/rest/action/cat/RestMasterAction.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 56172e41effe1..f8bb46d8c8ce8 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -44,14 +44,15 @@ import java.util.List; +import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; public class RestMasterAction extends AbstractCatAction { @Override - public List routes() { - return singletonList(new Route(GET, "/_cat/master")); + public List replacedRoutes() { + return singletonList(new ReplacedRoute(GET, "/_cat/cluster_manager", "/_cat/master")); } @Override From b23c566a1ab9a92dceb4eb49e2415d225bf3f744 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Mon, 7 Mar 2022 23:26:03 -0800 Subject: [PATCH 02/12] Add yaml rest test for cat cluster manager api Signed-off-by: Tianli Feng --- .../api/cat.cluster_manager.json | 51 +++++++++++++++++++ .../test/cat.cluster_manager/10_basic.yml | 36 +++++++++++++ .../test/cat.master/10_basic.yml | 39 ++++++++++++++ .../rest/action/cat/RestMasterAction.java | 4 +- 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml create mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json new file mode 100644 index 0000000000000..20122fb840956 --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json @@ -0,0 +1,51 @@ +{ + "cat.cluster_manager":{ + "documentation":{ + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-master/", + "description":"Returns information about the cluster manager node." + }, + "stability":"stable", + "url":{ + "paths":[ + { + "path":"/_cat/cluster_manager", + "methods":[ + "GET" + ] + } + ] + }, + "params":{ + "format":{ + "type":"string", + "description":"a short version of the Accept header, e.g. json, yaml" + }, + "local":{ + "type":"boolean", + "description":"Return local information, do not retrieve the state from master node (default: false)" + }, + "master_timeout":{ + "type":"time", + "description":"Explicit operation timeout for connection to master node" + }, + "h":{ + "type":"list", + "description":"Comma-separated list of column names to display" + }, + "help":{ + "type":"boolean", + "description":"Return help information", + "default":false + }, + "s":{ + "type":"list", + "description":"Comma-separated list of column names or column aliases to sort by" + }, + "v":{ + "type":"boolean", + "description":"Verbose mode. Display column headers", + "default":false + } + } + } +} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml new file mode 100644 index 0000000000000..0327619d9c35b --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml @@ -0,0 +1,36 @@ +--- +"Help": + - skip: + version: " - 1.4.99" + reason: "_cat/cluster_manager is introduced in 2.0.0" + - do: + cat.cluster_manager: + help: true + + - match: + $body: | + /^ id .+ \n + host .+ \n + ip .+ \n + node .+ \n + + $/ + +--- +"Test cat cluster_manager output": + - skip: + version: " - 1.4.99" + reason: "_cat/cluster_manager is introduced in 2.0.0" + - do: + cat.cluster_manager: {} + + - match: + $body: | + /^ + ( \S+ \s+ # node id + [-\w.]+ \s+ # host name + (\d{1,3}\.){3}\d{1,3} \s+ # ip address + [-\w.]+ # node name + \n + ) + $/ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml new file mode 100644 index 0000000000000..d7e1cc44038fe --- /dev/null +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml @@ -0,0 +1,39 @@ +--- +"Help": + - skip: + features: allowed_warnings + - do: + cat.master: + help: true + allowed_warnings: + - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' + + + - match: + $body: | + /^ id .+ \n + host .+ \n + ip .+ \n + node .+ \n + + $/ + +--- +"Test cat master output": + - skip: + features: allowed_warnings + - do: + cat.master: {} + allowed_warnings: + - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' + + - match: + $body: | + /^ + ( \S+ \s+ # node id + [-\w.]+ \s+ # host name + (\d{1,3}\.){3}\d{1,3} \s+ # ip address + [-\w.]+ # node name + \n + ) + $/ diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index f8bb46d8c8ce8..fe880e7a07c93 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -57,12 +57,12 @@ public List replacedRoutes() { @Override public String getName() { - return "cat_master_action"; + return "cat_cluster_manager_action"; } @Override protected void documentation(StringBuilder sb) { - sb.append("/_cat/master\n"); + sb.append("/_cat/cluster_manager\n"); } @Override From a33d5741f36629153031d4e39249d69725fcf257 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Mon, 7 Mar 2022 23:29:33 -0800 Subject: [PATCH 03/12] Remove an unused import Signed-off-by: Tianli Feng --- .../java/org/opensearch/rest/action/cat/RestMasterAction.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index fe880e7a07c93..212e64e609383 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -44,7 +44,6 @@ import java.util.List; -import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import static org.opensearch.rest.RestRequest.Method.GET; From bb79c85f999189ec487c6159693e366c985a0f7a Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 8 Mar 2022 14:07:59 -0800 Subject: [PATCH 04/12] Align the text in yml Signed-off-by: Tianli Feng --- .../rest-api-spec/test/cat.cluster_manager/10_basic.yml | 4 ++-- .../main/resources/rest-api-spec/test/cat.master/10_basic.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml index 0327619d9c35b..73dfed9c3848c 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml @@ -9,10 +9,10 @@ - match: $body: | - /^ id .+ \n + /^ id .+ \n host .+ \n ip .+ \n - node .+ \n + node .+ \n $/ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml index d7e1cc44038fe..fe56715874197 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml @@ -11,10 +11,10 @@ - match: $body: | - /^ id .+ \n + /^ id .+ \n host .+ \n ip .+ \n - node .+ \n + node .+ \n $/ From c6fe2373ba0d168a5b545bfb1fcf8145326e7b37 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 8 Mar 2022 17:08:39 -0800 Subject: [PATCH 05/12] Add a comment to indicate the removal in the future. Signed-off-by: Tianli Feng --- .../java/org/opensearch/rest/action/cat/RestMasterAction.java | 1 + 1 file changed, 1 insertion(+) diff --git a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java index 212e64e609383..1219b419122c6 100644 --- a/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/opensearch/rest/action/cat/RestMasterAction.java @@ -51,6 +51,7 @@ public class RestMasterAction extends AbstractCatAction { @Override public List replacedRoutes() { + // The deprecated path will be removed in a future major version. return singletonList(new ReplacedRoute(GET, "/_cat/cluster_manager", "/_cat/master")); } From 5a751e6a29d6aba2ac80be630ffd144564086e96 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Thu, 10 Mar 2022 23:17:05 -0800 Subject: [PATCH 06/12] Deprecate path cat master in rest api spec Signed-off-by: Tianli Feng --- .../src/main/resources/rest-api-spec/api/cat.master.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json index 63fe159ee56b8..81557859efcf9 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json @@ -11,7 +11,11 @@ "path":"/_cat/master", "methods":[ "GET" - ] + ], + "deprecated":{ + "version":"2.0.0", + "description":"To promote inclusive language, please use '/_cat/cluster_manager' instead." + } } ] }, From be447368a729f997afb8a7471fbadd5cf6d3e226 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Tue, 15 Mar 2022 23:02:32 -0700 Subject: [PATCH 07/12] Rename master to cluster-manager in cat.cluster_manager.json Signed-off-by: Tianli Feng --- .../main/resources/rest-api-spec/api/cat.cluster_manager.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json index 20122fb840956..e8caf05259659 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json @@ -2,7 +2,7 @@ "cat.cluster_manager":{ "documentation":{ "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-master/", - "description":"Returns information about the cluster manager node." + "description":"Returns information about the cluster-manager node." }, "stability":"stable", "url":{ @@ -22,7 +22,7 @@ }, "local":{ "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" + "description":"Return local information, do not retrieve the state from cluster-manager node (default: false)" }, "master_timeout":{ "type":"time", From 466b08380d82b11701a8535e9a6aefe7afccf1fa Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 16 Mar 2022 16:16:31 -0700 Subject: [PATCH 08/12] Remove the newly created cat.cluster_manager.json Signed-off-by: Tianli Feng --- .../api/cat.cluster_manager.json | 51 ------------------- .../rest-api-spec/api/cat.master.json | 8 ++- 2 files changed, 7 insertions(+), 52 deletions(-) delete mode 100644 rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json deleted file mode 100644 index e8caf05259659..0000000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "cat.cluster_manager":{ - "documentation":{ - "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-master/", - "description":"Returns information about the cluster-manager node." - }, - "stability":"stable", - "url":{ - "paths":[ - { - "path":"/_cat/cluster_manager", - "methods":[ - "GET" - ] - } - ] - }, - "params":{ - "format":{ - "type":"string", - "description":"a short version of the Accept header, e.g. json, yaml" - }, - "local":{ - "type":"boolean", - "description":"Return local information, do not retrieve the state from cluster-manager node (default: false)" - }, - "master_timeout":{ - "type":"time", - "description":"Explicit operation timeout for connection to master node" - }, - "h":{ - "type":"list", - "description":"Comma-separated list of column names to display" - }, - "help":{ - "type":"boolean", - "description":"Return help information", - "default":false - }, - "s":{ - "type":"list", - "description":"Comma-separated list of column names or column aliases to sort by" - }, - "v":{ - "type":"boolean", - "description":"Verbose mode. Display column headers", - "default":false - } - } - } -} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json index 81557859efcf9..77c97432c4e01 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json @@ -2,11 +2,17 @@ "cat.master":{ "documentation":{ "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", - "description":"Returns information about the master node." + "description":"Returns information about the cluster-manager node." }, "stability":"stable", "url":{ "paths":[ + { + "path":"/_cat/cluster_manager", + "methods":[ + "GET" + ] + }, { "path":"/_cat/master", "methods":[ From a17afa795e325d4f284390560fdbfd1b388aa4b3 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 16 Mar 2022 16:20:39 -0700 Subject: [PATCH 09/12] Remove the test for newly created cat.cluster_manager.json Signed-off-by: Tianli Feng --- .../test/cat.cluster_manager/10_basic.yml | 36 ------------------ .../test/cat.master/10_basic.yml | 38 ++++++++++++++++++- 2 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml deleted file mode 100644 index 73dfed9c3848c..0000000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Help": - - skip: - version: " - 1.4.99" - reason: "_cat/cluster_manager is introduced in 2.0.0" - - do: - cat.cluster_manager: - help: true - - - match: - $body: | - /^ id .+ \n - host .+ \n - ip .+ \n - node .+ \n - - $/ - ---- -"Test cat cluster_manager output": - - skip: - version: " - 1.4.99" - reason: "_cat/cluster_manager is introduced in 2.0.0" - - do: - cat.cluster_manager: {} - - - match: - $body: | - /^ - ( \S+ \s+ # node id - [-\w.]+ \s+ # host name - (\d{1,3}\.){3}\d{1,3} \s+ # ip address - [-\w.]+ # node name - \n - ) - $/ diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml index fe56715874197..b39c43d141a57 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml @@ -7,7 +7,6 @@ help: true allowed_warnings: - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - - match: $body: | @@ -37,3 +36,40 @@ \n ) $/ + +--- +"Help - cat cluster_manager": + - skip: + version: " - 1.4.99" + reason: "path _cat/cluster_manager is introduced in 2.0.0" + - do: + cat.cluster_manager: + help: true + + - match: + $body: | + /^ id .+ \n + host .+ \n + ip .+ \n + node .+ \n + + $/ + +--- +"Test cat cluster_manager output": + - skip: + version: " - 1.4.99" + reason: "path _cat/cluster_manager is introduced in 2.0.0" + - do: + cat.cluster_manager: {} + + - match: + $body: | + /^ + ( \S+ \s+ # node id + [-\w.]+ \s+ # host name + (\d{1,3}\.){3}\d{1,3} \s+ # ip address + [-\w.]+ # node name + \n + ) + $/ From c46e535712ff08b11d8f152dbd0ea1f9079d1beb Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 16 Mar 2022 16:27:03 -0700 Subject: [PATCH 10/12] Rename cat.master rest-api-spec to cat.cluster_manager Signed-off-by: Tianli Feng --- ...t.master.json => cat.cluster_manager.json} | 6 +- .../10_basic.yml | 62 +++++++++---------- 2 files changed, 34 insertions(+), 34 deletions(-) rename rest-api-spec/src/main/resources/rest-api-spec/api/{cat.master.json => cat.cluster_manager.json} (89%) rename rest-api-spec/src/main/resources/rest-api-spec/test/{cat.master => cat.cluster_manager}/10_basic.yml (67%) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json similarity index 89% rename from rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json rename to rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json index 77c97432c4e01..c1084825546bf 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.master.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.cluster_manager.json @@ -1,7 +1,7 @@ { - "cat.master":{ + "cat.cluster_manager":{ "documentation":{ - "url":"https://www.elastic.co/guide/en/elasticsearch/reference/master/cat-master.html", + "url":"https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-master/", "description":"Returns information about the cluster-manager node." }, "stability":"stable", @@ -32,7 +32,7 @@ }, "local":{ "type":"boolean", - "description":"Return local information, do not retrieve the state from master node (default: false)" + "description":"Return local information, do not retrieve the state from cluster-manager node (default: false)" }, "master_timeout":{ "type":"time", diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml similarity index 67% rename from rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml rename to rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml index b39c43d141a57..0f778b6658555 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.master/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml @@ -1,50 +1,49 @@ --- "Help": - skip: - features: allowed_warnings + version: " - 1.4.99" + reason: "path _cat/cluster_manager is introduced in 2.0.0" - do: - cat.master: + cat.cluster_manager: help: true - allowed_warnings: - - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - match: $body: | - /^ id .+ \n - host .+ \n - ip .+ \n - node .+ \n - - $/ + /^ id .+ \n + host .+ \n + ip .+ \n + node .+ \n + + $/ --- -"Test cat master output": +"Test cat cluster_manager output": - skip: - features: allowed_warnings + version: " - 1.4.99" + reason: "path _cat/cluster_manager is introduced in 2.0.0" - do: - cat.master: {} - allowed_warnings: - - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' + cat.cluster_manager: {} - match: $body: | - /^ - ( \S+ \s+ # node id - [-\w.]+ \s+ # host name - (\d{1,3}\.){3}\d{1,3} \s+ # ip address - [-\w.]+ # node name - \n - ) - $/ + /^ + ( \S+ \s+ # node id + [-\w.]+ \s+ # host name + (\d{1,3}\.){3}\d{1,3} \s+ # ip address + [-\w.]+ # node name + \n + ) + $/ --- -"Help - cat cluster_manager": +"Help - cat master": - skip: - version: " - 1.4.99" - reason: "path _cat/cluster_manager is introduced in 2.0.0" + features: allowed_warnings - do: - cat.cluster_manager: + cat.master: help: true + allowed_warnings: + - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - match: $body: | @@ -56,12 +55,13 @@ $/ --- -"Test cat cluster_manager output": +"Test cat master output": - skip: - version: " - 1.4.99" - reason: "path _cat/cluster_manager is introduced in 2.0.0" + features: allowed_warnings - do: - cat.cluster_manager: {} + cat.master: {} + allowed_warnings: + - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - match: $body: | From 0b7b236e1853b08ab2350f727b8ff499789d1539 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 16 Mar 2022 17:27:55 -0700 Subject: [PATCH 11/12] Fix yaml rest test by remove cat.master Signed-off-by: Tianli Feng --- .../test/cat.cluster_manager/10_basic.yml | 41 +++---------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml index 0f778b6658555..12788e4db29d3 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml @@ -3,9 +3,13 @@ - skip: version: " - 1.4.99" reason: "path _cat/cluster_manager is introduced in 2.0.0" + features: allowed_warnings + - do: cat.cluster_manager: help: true + allowed_warnings: + - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - match: $body: | @@ -21,45 +25,10 @@ - skip: version: " - 1.4.99" reason: "path _cat/cluster_manager is introduced in 2.0.0" - - do: - cat.cluster_manager: {} - - - match: - $body: | - /^ - ( \S+ \s+ # node id - [-\w.]+ \s+ # host name - (\d{1,3}\.){3}\d{1,3} \s+ # ip address - [-\w.]+ # node name - \n - ) - $/ - ---- -"Help - cat master": - - skip: features: allowed_warnings - - do: - cat.master: - help: true - allowed_warnings: - - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' - - - match: - $body: | - /^ id .+ \n - host .+ \n - ip .+ \n - node .+ \n - - $/ ---- -"Test cat master output": - - skip: - features: allowed_warnings - do: - cat.master: {} + cat.cluster_manager: {} allowed_warnings: - '[GET /_cat/master] is deprecated! Use [GET /_cat/cluster_manager] instead.' From 300f18b620016092fc240ae171c141483aa72069 Mon Sep 17 00:00:00 2001 From: Tianli Feng Date: Wed, 16 Mar 2022 22:33:25 -0700 Subject: [PATCH 12/12] put allowed_warnings in setup section Signed-off-by: Tianli Feng --- .../rest-api-spec/test/cat.cluster_manager/10_basic.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml index 12788e4db29d3..b0f1c81b56a0e 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.cluster_manager/10_basic.yml @@ -1,9 +1,12 @@ +setup: + - skip: + features: allowed_warnings + --- "Help": - skip: version: " - 1.4.99" reason: "path _cat/cluster_manager is introduced in 2.0.0" - features: allowed_warnings - do: cat.cluster_manager: @@ -25,7 +28,6 @@ - skip: version: " - 1.4.99" reason: "path _cat/cluster_manager is introduced in 2.0.0" - features: allowed_warnings - do: cat.cluster_manager: {}