diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java index 6333c7391f60e..af94cb97c70c8 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/bulk/RestNoopBulkAction.java @@ -50,10 +50,10 @@ public class RestNoopBulkAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_noop_bulk", POST), - new Route("/_noop_bulk", PUT), - new Route("/{index}/_noop_bulk", POST), - new Route("/{index}/_noop_bulk", PUT))); + new Route(POST, "/_noop_bulk"), + new Route(PUT, "/_noop_bulk"), + new Route(POST, "/{index}/_noop_bulk"), + new Route(PUT, "/{index}/_noop_bulk"))); } @Override diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/RestNoopSearchAction.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/RestNoopSearchAction.java index 15cb525d49a66..a9b0fe2d84cb4 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/RestNoopSearchAction.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/action/search/RestNoopSearchAction.java @@ -36,10 +36,10 @@ public class RestNoopSearchAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_noop_search", GET), - new Route("/_noop_search", POST), - new Route("/{index}/_noop_search", GET), - new Route("/{index}/_noop_search", POST))); + new Route(GET, "/_noop_search"), + new Route(POST, "/_noop_search"), + new Route(GET, "/{index}/_noop_search"), + new Route(POST, "/{index}/_noop_search"))); } @Override diff --git a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java index 1e212b007bbb5..ee277addd20ec 100644 --- a/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java +++ b/modules/ingest-common/src/main/java/org/elasticsearch/ingest/common/GrokProcessorGetAction.java @@ -120,7 +120,7 @@ public static class RestAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ingest/processor/grok", GET)); + return singletonList(new Route(GET, "/_ingest/processor/grok")); } @Override diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java index 6669132395b86..72403afc423e2 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java @@ -59,10 +59,10 @@ public RestMultiSearchTemplateAction(Settings settings) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_msearch/template", GET), - new Route("/_msearch/template", POST), - new Route("/{index}/_msearch/template", GET), - new Route("/{index}/_msearch/template", POST))); + new Route(GET, "/_msearch/template"), + new Route(POST, "/_msearch/template"), + new Route(GET, "/{index}/_msearch/template"), + new Route(POST, "/{index}/_msearch/template"))); } @Override diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java index 2a78684daede6..d6635c060993a 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestRenderSearchTemplateAction.java @@ -39,10 +39,10 @@ public class RestRenderSearchTemplateAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_render/template", GET), - new Route("/_render/template", POST), - new Route("/_render/template/{id}", GET), - new Route("/_render/template/{id}", POST))); + new Route(GET, "/_render/template"), + new Route(POST, "/_render/template"), + new Route(GET, "/_render/template/{id}"), + new Route(POST, "/_render/template/{id}"))); } @Override diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java index ea8f54a2b7ca4..7baf7c8cca4c2 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java @@ -51,10 +51,10 @@ public class RestSearchTemplateAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_search/template", GET), - new Route("/_search/template", POST), - new Route("/{index}/_search/template", GET), - new Route("/{index}/_search/template", POST))); + new Route(GET, "/_search/template"), + new Route(POST, "/_search/template"), + new Route(GET, "/{index}/_search/template"), + new Route(POST, "/{index}/_search/template"))); } @Override diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java index 7e77f484fe102..2963d68a7cf98 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessContextAction.java @@ -196,7 +196,7 @@ public static class RestAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_scripts/painless/_context", GET)); + return singletonList(new Route(GET, "/_scripts/painless/_context")); } @Override diff --git a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java index bf6cbee1cd7bb..048067e90580b 100644 --- a/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java +++ b/modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java @@ -569,8 +569,8 @@ public static class RestAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_scripts/painless/_execute", GET), - new Route("/_scripts/painless/_execute", POST))); + new Route(GET, "/_scripts/painless/_execute"), + new Route(POST, "/_scripts/painless/_execute"))); } @Override diff --git a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java index 452425303a25e..6874935c97a8e 100644 --- a/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java +++ b/modules/rank-eval/src/main/java/org/elasticsearch/index/rankeval/RestRankEvalAction.java @@ -95,10 +95,10 @@ public class RestRankEvalAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/" + ENDPOINT, GET), - new Route("/" + ENDPOINT, POST), - new Route("/{index}/" + ENDPOINT, GET), - new Route("/{index}/" + ENDPOINT, POST))); + new Route(GET, "/" + ENDPOINT), + new Route(POST, "/" + ENDPOINT), + new Route(GET, "/{index}/" + ENDPOINT), + new Route(POST, "/{index}/" + ENDPOINT))); } @Override diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java index 162fcc4ae72f5..0f4983d570e6a 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java @@ -39,7 +39,7 @@ public RestDeleteByQueryAction() { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_delete_by_query", POST)); + return singletonList(new Route(POST, "/{index}/_delete_by_query")); } @Override diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestReindexAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestReindexAction.java index e84034ee25d19..bb5d2e5def5b1 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestReindexAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestReindexAction.java @@ -41,7 +41,7 @@ public RestReindexAction() { @Override public List handledRoutes() { - return singletonList(new Route("/_reindex", POST)); + return singletonList(new Route(POST, "/_reindex")); } @Override diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestRethrottleAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestRethrottleAction.java index 40d9d1edadcad..dedb57db26961 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestRethrottleAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestRethrottleAction.java @@ -43,9 +43,9 @@ public RestRethrottleAction(Supplier nodesInCluster) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_update_by_query/{taskId}/_rethrottle", POST), - new Route("/_delete_by_query/{taskId}/_rethrottle", POST), - new Route("/_reindex/{taskId}/_rethrottle", POST))); + new Route(POST, "/_update_by_query/{taskId}/_rethrottle"), + new Route(POST, "/_delete_by_query/{taskId}/_rethrottle"), + new Route(POST, "/_reindex/{taskId}/_rethrottle"))); } @Override diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java index 42423cbfb8b46..f6bcfac9b10ea 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java @@ -46,7 +46,7 @@ public RestUpdateByQueryAction() { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_update_by_query", POST)); + return singletonList(new Route(POST, "/{index}/_update_by_query")); } @Override diff --git a/plugins/examples/rest-handler/src/main/java/org/elasticsearch/example/resthandler/ExampleCatAction.java b/plugins/examples/rest-handler/src/main/java/org/elasticsearch/example/resthandler/ExampleCatAction.java index b29abf73f8a3c..7110cac467a8f 100644 --- a/plugins/examples/rest-handler/src/main/java/org/elasticsearch/example/resthandler/ExampleCatAction.java +++ b/plugins/examples/rest-handler/src/main/java/org/elasticsearch/example/resthandler/ExampleCatAction.java @@ -40,8 +40,8 @@ public class ExampleCatAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/example", GET), - new Route("/_cat/example", POST))); + new Route(GET, "/_cat/example"), + new Route(POST, "/_cat/example"))); } @Override diff --git a/qa/die-with-dignity/src/main/java/org/elasticsearch/RestDieWithDignityAction.java b/qa/die-with-dignity/src/main/java/org/elasticsearch/RestDieWithDignityAction.java index df370ccb55fc7..a15251b58f512 100644 --- a/qa/die-with-dignity/src/main/java/org/elasticsearch/RestDieWithDignityAction.java +++ b/qa/die-with-dignity/src/main/java/org/elasticsearch/RestDieWithDignityAction.java @@ -34,7 +34,7 @@ public class RestDieWithDignityAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_die_with_dignity", GET)); + return singletonList(new Route(GET, "/_die_with_dignity")); } @Override diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestDeprecationHeaderRestAction.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestDeprecationHeaderRestAction.java index c0010f00ec354..08f7d68e91f41 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestDeprecationHeaderRestAction.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestDeprecationHeaderRestAction.java @@ -76,7 +76,7 @@ public TestDeprecationHeaderRestAction(Settings settings) { @Override public List deprecatedRoutes() { return singletonList( - new DeprecatedRoute("/_test_cluster/deprecated_settings", GET, DEPRECATED_ENDPOINT, deprecationLogger)); + new DeprecatedRoute(GET, "/_test_cluster/deprecated_settings", DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestResponseHeaderRestAction.java b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestResponseHeaderRestAction.java index 752316b6b23c5..62f57178ef177 100644 --- a/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestResponseHeaderRestAction.java +++ b/qa/smoke-test-http/src/test/java/org/elasticsearch/http/TestResponseHeaderRestAction.java @@ -34,7 +34,7 @@ public class TestResponseHeaderRestAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_protected", GET)); + return singletonList(new Route(GET, "/_protected")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/RestHandler.java b/server/src/main/java/org/elasticsearch/rest/RestHandler.java index cc0edc3097fb0..bd37cd4aa4d94 100644 --- a/server/src/main/java/org/elasticsearch/rest/RestHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/RestHandler.java @@ -95,7 +95,7 @@ class Route { private final String path; private final Method method; - public Route(String path, Method method) { + public Route(Method method, String path) { this.path = path; this.method = method; } @@ -117,8 +117,8 @@ class DeprecatedRoute extends Route { private final String deprecationMessage; private final DeprecationLogger logger; - public DeprecatedRoute(String path, Method method, String deprecationMessage, DeprecationLogger logger) { - super(path, method); + public DeprecatedRoute(Method method, String path, String deprecationMessage, DeprecationLogger logger) { + super(method, path); this.deprecationMessage = deprecationMessage; this.logger = logger; } @@ -143,7 +143,7 @@ class ReplacedRoute extends Route { private final DeprecationLogger logger; public ReplacedRoute(Method method, String path, Method deprecatedMethod, String deprecatedPath, DeprecationLogger logger) { - super(path, method); + super(method, path); this.deprecatedMethod = deprecatedMethod; this.deprecatedPath = deprecatedPath; this.logger = logger; diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java b/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java index eb83a7c6de7a5..3355435d567a7 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestFieldCapabilitiesAction.java @@ -39,10 +39,10 @@ public class RestFieldCapabilitiesAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_field_caps", GET), - new Route("/_field_caps", POST), - new Route("/{index}/_field_caps", GET), - new Route("/{index}/_field_caps", POST))); + new Route(GET, "/_field_caps"), + new Route(POST, "/_field_caps"), + new Route(GET, "/{index}/_field_caps"), + new Route(POST, "/{index}/_field_caps"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java b/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java index da86dfef1982f..025a03b16486f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/RestMainAction.java @@ -43,8 +43,8 @@ public class RestMainAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/", GET), - new Route("/", HEAD))); + new Route(GET, "/"), + new Route(HEAD, "/"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java index bea4dbfb1f21a..2d257cca71c03 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java @@ -45,7 +45,7 @@ public String getName() { @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/voting_config_exclusions/{node_name}", POST)); + return singletonList(new Route(POST, "/_cluster/voting_config_exclusions/{node_name}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCancelTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCancelTasksAction.java index 75b2cb5f8d8f1..820806bc5b47b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCancelTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCancelTasksAction.java @@ -51,8 +51,8 @@ public String getName() { @Override public List handledRoutes() { - return unmodifiableList(asList(new Route("/_tasks/_cancel", POST), - new Route("/_tasks/{task_id}/_cancel", POST))); + return unmodifiableList(asList(new Route(POST, "/_tasks/_cancel"), + new Route(POST, "/_tasks/{task_id}/_cancel"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java index aa4421ea75d72..7ac61a69820da 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCleanupRepositoryAction.java @@ -39,7 +39,7 @@ public class RestCleanupRepositoryAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}/_cleanup", POST)); + return singletonList(new Route(POST, "/_snapshot/{repository}/_cleanup")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java index d07c94a4a7563..7012284287266 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClearVotingConfigExclusionsAction.java @@ -36,7 +36,7 @@ public class RestClearVotingConfigExclusionsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/voting_config_exclusions", DELETE)); + return singletonList(new Route(DELETE, "/_cluster/voting_config_exclusions")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java index 7a58e4cda682b..8391d8279cb5c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterAllocationExplainAction.java @@ -48,8 +48,8 @@ public class RestClusterAllocationExplainAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cluster/allocation/explain", GET), - new Route("/_cluster/allocation/explain", POST))); + new Route(GET, "/_cluster/allocation/explain"), + new Route(POST, "/_cluster/allocation/explain"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java index 14c348f5649de..157de85ff57a9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterGetSettingsAction.java @@ -58,7 +58,7 @@ public RestClusterGetSettingsAction(Settings settings, ClusterSettings clusterSe @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/settings", GET)); + return singletonList(new Route(GET, "/_cluster/settings")); } @Override public String getName() { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterHealthAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterHealthAction.java index 613331f8fbd94..acb8248eb44d2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterHealthAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterHealthAction.java @@ -45,8 +45,8 @@ public class RestClusterHealthAction extends BaseRestHandler { @Override public List handledRoutes() { - return unmodifiableList(asList(new Route("/_cluster/health", GET), - new Route("/_cluster/health/{index}", GET))); + return unmodifiableList(asList(new Route(GET, "/_cluster/health"), + new Route(GET, "/_cluster/health/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java index e33d950a0e8bd..6a2679e1f5bf4 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterRerouteAction.java @@ -63,7 +63,7 @@ public RestClusterRerouteAction(SettingsFilter settingsFilter) { @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/reroute", POST)); + return singletonList(new Route(POST, "/_cluster/reroute")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java index 55969bc892015..0cb32cb0b6219 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterSearchShardsAction.java @@ -41,10 +41,10 @@ public class RestClusterSearchShardsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_search_shards", GET), - new Route("/_search_shards", POST), - new Route("/{index}/_search_shards", GET), - new Route("/{index}/_search_shards", POST))); + new Route(GET, "/_search_shards"), + new Route(POST, "/_search_shards"), + new Route(GET, "/{index}/_search_shards"), + new Route(POST, "/{index}/_search_shards"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java index de95a90fd2256..b938bc1e9fc2a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStateAction.java @@ -63,9 +63,9 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cluster/state", GET), - new Route("/_cluster/state/{metric}", GET), - new Route("/_cluster/state/{metric}/{indices}", GET))); + new Route(GET, "/_cluster/state"), + new Route(GET, "/_cluster/state/{metric}"), + new Route(GET, "/_cluster/state/{metric}/{indices}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java index 41aca857cfee8..e3bee7ade71b9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterStatsAction.java @@ -37,8 +37,8 @@ public class RestClusterStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cluster/stats", GET), - new Route("/_cluster/stats/nodes/{nodeId}", GET))); + new Route(GET, "/_cluster/stats"), + new Route(GET, "/_cluster/stats/nodes/{nodeId}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java index 614b22a201217..0556e68cd2cef 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestClusterUpdateSettingsAction.java @@ -43,7 +43,7 @@ public class RestClusterUpdateSettingsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/settings", PUT)); + return singletonList(new Route(PUT, "/_cluster/settings")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCreateSnapshotAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCreateSnapshotAction.java index 840f9ea6a28dd..db7cae7b063e8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCreateSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestCreateSnapshotAction.java @@ -42,8 +42,8 @@ public class RestCreateSnapshotAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_snapshot/{repository}/{snapshot}", PUT), - new Route("/_snapshot/{repository}/{snapshot}", POST))); + new Route(PUT, "/_snapshot/{repository}/{snapshot}"), + new Route(POST, "/_snapshot/{repository}/{snapshot}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java index ee79820d22129..5436bf1035872 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteRepositoryAction.java @@ -39,7 +39,7 @@ public class RestDeleteRepositoryAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}", DELETE)); + return singletonList(new Route(DELETE, "/_snapshot/{repository}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java index 8249d64f20bd5..68951288d575f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteSnapshotAction.java @@ -39,7 +39,7 @@ public class RestDeleteSnapshotAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}/{snapshot}", DELETE)); + return singletonList(new Route(DELETE, "/_snapshot/{repository}/{snapshot}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java index 8a93865857a19..51da84f865a39 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestDeleteStoredScriptAction.java @@ -34,7 +34,7 @@ public class RestDeleteStoredScriptAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_scripts/{id}", DELETE)); + return singletonList(new Route(DELETE, "/_scripts/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetRepositoriesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetRepositoriesAction.java index 82276f67c6aa3..1503a0bd60bcc 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetRepositoriesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetRepositoriesAction.java @@ -56,8 +56,8 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_snapshot", GET), - new Route("/_snapshot/{repository}", GET))); + new Route(GET, "/_snapshot"), + new Route(GET, "/_snapshot/{repository}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptContextAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptContextAction.java index c0f1f0d30bf2e..c8c048496d835 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptContextAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptContextAction.java @@ -36,7 +36,7 @@ public class RestGetScriptContextAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_script_context", GET)); + return singletonList(new Route(GET, "/_script_context")); } @Override public String getName() { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java index 707ebe463829c..9e54adf566403 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetScriptLanguageAction.java @@ -36,7 +36,7 @@ public class RestGetScriptLanguageAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_script_language", GET)); + return singletonList(new Route(GET, "/_script_language")); } @Override public String getName() { diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetSnapshotsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetSnapshotsAction.java index 3bd8faa2cf8b5..97c39b7f22132 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetSnapshotsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetSnapshotsAction.java @@ -40,7 +40,7 @@ public class RestGetSnapshotsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}/{snapshot}", GET)); + return singletonList(new Route(GET, "/_snapshot/{repository}/{snapshot}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetStoredScriptAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetStoredScriptAction.java index 09059c218c760..4862dcab0a07e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetStoredScriptAction.java @@ -34,7 +34,7 @@ public class RestGetStoredScriptAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_scripts/{id}", GET)); + return singletonList(new Route(GET, "/_scripts/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetTaskAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetTaskAction.java index 357f8342ab94c..d540897d7f413 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetTaskAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestGetTaskAction.java @@ -37,7 +37,7 @@ public class RestGetTaskAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_tasks/{task_id}", GET)); + return singletonList(new Route(GET, "/_tasks/{task_id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java index 2ab497a956a8e..ba425eb0cfd30 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestListTasksAction.java @@ -55,7 +55,7 @@ public RestListTasksAction(Supplier nodesInCluster) { @Override public List handledRoutes() { - return singletonList(new Route("/_tasks", GET)); + return singletonList(new Route(GET, "/_tasks")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java index ce4428d2da49c..aac11df51e565 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java @@ -45,14 +45,14 @@ public class RestNodesHotThreadsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cluster/nodes/hotthreads", GET), - new Route("/_cluster/nodes/hot_threads", GET), - new Route("/_cluster/nodes/{nodeId}/hotthreads", GET), - new Route("/_cluster/nodes/{nodeId}/hot_threads", GET), - new Route("/_nodes/hotthreads", GET), - new Route("/_nodes/hot_threads", GET), - new Route("/_nodes/{nodeId}/hotthreads", GET), - new Route("/_nodes/{nodeId}/hot_threads", GET))); + new Route(GET, "/_cluster/nodes/hotthreads"), + new Route(GET, "/_cluster/nodes/hot_threads"), + new Route(GET, "/_cluster/nodes/{nodeId}/hotthreads"), + new Route(GET, "/_cluster/nodes/{nodeId}/hot_threads"), + new Route(GET, "/_nodes/hotthreads"), + new Route(GET, "/_nodes/hot_threads"), + new Route(GET, "/_nodes/{nodeId}/hotthreads"), + new Route(GET, "/_nodes/{nodeId}/hot_threads"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesInfoAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesInfoAction.java index ab1fa61e50f2a..87fd7ddb2cd95 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesInfoAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesInfoAction.java @@ -59,12 +59,12 @@ public RestNodesInfoAction(SettingsFilter settingsFilter) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_nodes", GET), + new Route(GET, "/_nodes"), // this endpoint is used for metrics, not for node IDs, like /_nodes/fs - new Route("/_nodes/{nodeId}", GET), - new Route("/_nodes/{nodeId}/{metrics}", GET), + new Route(GET, "/_nodes/{nodeId}"), + new Route(GET, "/_nodes/{nodeId}/{metrics}"), // added this endpoint to be aligned with stats - new Route("/_nodes/{nodeId}/info/{metrics}", GET))); + new Route(GET, "/_nodes/{nodeId}/info/{metrics}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesStatsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesStatsAction.java index 247530811ee32..032a288b61227 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesStatsAction.java @@ -48,12 +48,12 @@ public class RestNodesStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_nodes/stats", GET), - new Route("/_nodes/{nodeId}/stats", GET), - new Route("/_nodes/stats/{metric}", GET), - new Route("/_nodes/{nodeId}/stats/{metric}", GET), - new Route("/_nodes/stats/{metric}/{index_metric}", GET), - new Route("/_nodes/{nodeId}/stats/{metric}/{index_metric}", GET))); + new Route(GET, "/_nodes/stats"), + new Route(GET, "/_nodes/{nodeId}/stats"), + new Route(GET, "/_nodes/stats/{metric}"), + new Route(GET, "/_nodes/{nodeId}/stats/{metric}"), + new Route(GET, "/_nodes/stats/{metric}/{index_metric}"), + new Route(GET, "/_nodes/{nodeId}/stats/{metric}/{index_metric}"))); } static final Map> METRICS = Map.ofEntries( diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java index 28a5dbc41a642..c5aa7fcf0bebe 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesUsageAction.java @@ -46,10 +46,10 @@ public class RestNodesUsageAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_nodes/usage", GET), - new Route("/_nodes/{nodeId}/usage", GET), - new Route("/_nodes/usage/{metric}", GET), - new Route("/_nodes/{nodeId}/usage/{metric}", GET))); + new Route(GET, "/_nodes/usage"), + new Route(GET, "/_nodes/{nodeId}/usage"), + new Route(GET, "/_nodes/usage/{metric}"), + new Route(GET, "/_nodes/{nodeId}/usage/{metric}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java index f4a5de4aec7b4..c6cb9b3791b8a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPendingClusterTasksAction.java @@ -35,7 +35,7 @@ public class RestPendingClusterTasksAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_cluster/pending_tasks", GET)); + return singletonList(new Route(GET, "/_cluster/pending_tasks")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java index 4dec6ae142314..6545382b02ca3 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutRepositoryAction.java @@ -43,8 +43,8 @@ public class RestPutRepositoryAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_snapshot/{repository}", POST), - new Route("/_snapshot/{repository}", PUT))); + new Route(POST, "/_snapshot/{repository}"), + new Route(PUT, "/_snapshot/{repository}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java index 9100125c72754..f6da6ebbf34ed 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestPutStoredScriptAction.java @@ -40,10 +40,10 @@ public class RestPutStoredScriptAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_scripts/{id}", POST), - new Route("/_scripts/{id}", PUT), - new Route("/_scripts/{id}/{context}", POST), - new Route("/_scripts/{id}/{context}", PUT))); + new Route(POST, "/_scripts/{id}"), + new Route(PUT, "/_scripts/{id}"), + new Route(POST, "/_scripts/{id}/{context}"), + new Route(PUT, "/_scripts/{id}/{context}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java index a15e62f703816..45b6271b621ce 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestReloadSecureSettingsAction.java @@ -61,8 +61,8 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_nodes/reload_secure_settings", POST), - new Route("/_nodes/{nodeId}/reload_secure_settings", POST))); + new Route(POST, "/_nodes/reload_secure_settings"), + new Route(POST, "/_nodes/{nodeId}/reload_secure_settings"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java index 1d0d46ce525fd..15d69560df0f1 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRemoteClusterInfoAction.java @@ -35,7 +35,7 @@ public final class RestRemoteClusterInfoAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("_remote/info", GET)); + return singletonList(new Route(GET, "_remote/info")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java index 4276880a8a48e..985ffbe575590 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestRestoreSnapshotAction.java @@ -39,7 +39,7 @@ public class RestRestoreSnapshotAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}/{snapshot}/_restore", POST)); + return singletonList(new Route(POST, "/_snapshot/{repository}/{snapshot}/_restore")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java index de29792d589b6..dacdd07ac833d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestSnapshotsStatusAction.java @@ -42,9 +42,9 @@ public class RestSnapshotsStatusAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_snapshot/{repository}/{snapshot}/_status", GET), - new Route("/_snapshot/{repository}/_status", GET), - new Route("/_snapshot/_status", GET))); + new Route(GET, "/_snapshot/{repository}/{snapshot}/_status"), + new Route(GET, "/_snapshot/{repository}/_status"), + new Route(GET, "/_snapshot/_status"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java index c2c557d58d03a..7a38348c72db4 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestVerifyRepositoryAction.java @@ -36,7 +36,7 @@ public class RestVerifyRepositoryAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_snapshot/{repository}/_verify", POST)); + return singletonList(new Route(POST, "/_snapshot/{repository}/_verify")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java index 357aa0ee42c0e..ecae40d4e7842 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestAnalyzeAction.java @@ -51,10 +51,10 @@ public static class Fields { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_analyze", GET), - new Route("/_analyze", POST), - new Route("/{index}/_analyze", GET), - new Route("/{index}/_analyze", POST))); + new Route(GET, "/_analyze"), + new Route(POST, "/_analyze"), + new Route(GET, "/{index}/_analyze"), + new Route(POST, "/{index}/_analyze"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java index c48e4bc882034..97d0c13b39b8d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestClearIndicesCacheAction.java @@ -39,8 +39,8 @@ public class RestClearIndicesCacheAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cache/clear", POST), - new Route("/{index}/_cache/clear", POST))); + new Route(POST, "/_cache/clear"), + new Route(POST, "/{index}/_cache/clear"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java index 11cf94358c8ee..e18c94cce7e43 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCloseIndexAction.java @@ -40,8 +40,8 @@ public class RestCloseIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_close", POST), - new Route("/{index}/_close", POST))); + new Route(POST, "/_close"), + new Route(POST, "/{index}/_close"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java index dea25679dee02..c677d985f7c40 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestCreateIndexAction.java @@ -42,7 +42,7 @@ public class RestCreateIndexAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}", PUT)); + return singletonList(new Route(PUT, "/{index}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexAction.java index ace876907af61..966f22190871c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexAction.java @@ -39,8 +39,8 @@ public class RestDeleteIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/", DELETE), - new Route("/{index}", DELETE))); + new Route(DELETE, "/"), + new Route(DELETE, "/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java index 44b231ce84f19..c1d08d6de6381 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestDeleteIndexTemplateAction.java @@ -34,7 +34,7 @@ public class RestDeleteIndexTemplateAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_template/{name}", DELETE)); + return singletonList(new Route(DELETE, "/_template/{name}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestFlushAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestFlushAction.java index 99222bbd1cb3c..84677e60a0147 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestFlushAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestFlushAction.java @@ -40,10 +40,10 @@ public class RestFlushAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_flush", GET), - new Route("/_flush", POST), - new Route("/{index}/_flush", GET), - new Route("/{index}/_flush", POST))); + new Route(GET, "/_flush"), + new Route(POST, "/_flush"), + new Route(GET, "/{index}/_flush"), + new Route(POST, "/{index}/_flush"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java index 10996ef7e9110..797d2d6f27da5 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestForceMergeAction.java @@ -39,8 +39,8 @@ public class RestForceMergeAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_forcemerge", POST), - new Route("/{index}/_forcemerge", POST))); + new Route(POST, "/_forcemerge"), + new Route(POST, "/{index}/_forcemerge"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java index 13259b23bcc32..d9368aaf086fe 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAliasesAction.java @@ -59,14 +59,14 @@ public class RestGetAliasesAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_alias", GET), - new Route("/_aliases", GET), - new Route("/_alias/{name}", GET), - new Route("/_alias/{name}", HEAD), - new Route("/{index}/_alias", GET), - new Route("/{index}/_alias", HEAD), - new Route("/{index}/_alias/{name}", GET), - new Route("/{index}/_alias/{name}", HEAD))); + new Route(GET, "/_alias"), + new Route(GET, "/_aliases"), + new Route(GET, "/_alias/{name}"), + new Route(HEAD, "/_alias/{name}"), + new Route(GET, "/{index}/_alias"), + new Route(HEAD, "/{index}/_alias"), + new Route(GET, "/{index}/_alias/{name}"), + new Route(HEAD, "/{index}/_alias/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java index 4762e3c022af8..8dbfc6ece48a5 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java @@ -48,8 +48,8 @@ public class RestGetFieldMappingAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_mapping/field/{fields}", GET), - new Route("/{index}/_mapping/field/{fields}", GET))); + new Route(GET, "/_mapping/field/{fields}"), + new Route(GET, "/{index}/_mapping/field/{fields}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java index a20b9cb3e2108..addfc75b00412 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndexTemplateAction.java @@ -48,9 +48,9 @@ public class RestGetIndexTemplateAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_template", GET), - new Route("/_template/{name}", GET), - new Route("/_template/{name}", HEAD))); + new Route(GET, "/_template"), + new Route(GET, "/_template/{name}"), + new Route(HEAD, "/_template/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java index 4687bdff35936..f6579cb1c729c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetIndicesAction.java @@ -46,8 +46,8 @@ public class RestGetIndicesAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}", GET), - new Route("/{index}", HEAD))); + new Route(GET, "/{index}"), + new Route(HEAD, "/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java index 33c5e1c0f5a52..cf0204e31a42f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java @@ -44,10 +44,10 @@ public class RestGetMappingAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_mapping", GET), - new Route("/_mappings", GET), - new Route("/{index}/_mapping", GET), - new Route("/{index}/_mappings", GET))); + new Route(GET, "/_mapping"), + new Route(GET, "/_mappings"), + new Route(GET, "/{index}/_mapping"), + new Route(GET, "/{index}/_mappings"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java index c16fa4400d0aa..80fcdc77a22c2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java @@ -39,11 +39,11 @@ public class RestGetSettingsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_settings", GET), - new Route("/_settings/{name}", GET), - new Route("/{index}/_settings", GET), - new Route("/{index}/_settings/{name}", GET), - new Route("/{index}/_setting/{name}", GET))); + new Route(GET, "/_settings"), + new Route(GET, "/_settings/{name}"), + new Route(GET, "/{index}/_settings"), + new Route(GET, "/{index}/_settings/{name}"), + new Route(GET, "/{index}/_setting/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java index 2f5035b7a01e1..a5b01c96b52fc 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexDeleteAliasesAction.java @@ -38,8 +38,8 @@ public class RestIndexDeleteAliasesAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_alias/{name}", DELETE), - new Route("/{index}/_aliases/{name}", DELETE))); + new Route(DELETE, "/{index}/_alias/{name}"), + new Route(DELETE, "/{index}/_aliases/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java index 33e801fd94c8f..bb5daf7943fbd 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndexPutAliasAction.java @@ -41,17 +41,17 @@ public class RestIndexPutAliasAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_alias/{name}", POST), - new Route("/{index}/_alias/{name}", PUT), - new Route("/_alias/{name}", POST), - new Route("/_alias/{name}", PUT), - new Route("/{index}/_aliases/{name}", POST), - new Route("/{index}/_aliases/{name}", PUT), - new Route("/_aliases/{name}", POST), - new Route("/_aliases/{name}", PUT), - new Route("/{index}/_alias", PUT), - new Route("/{index}/_aliases", PUT), - new Route("/_alias", PUT))); + new Route(POST, "/{index}/_alias/{name}"), + new Route(PUT, "/{index}/_alias/{name}"), + new Route(POST, "/_alias/{name}"), + new Route(PUT, "/_alias/{name}"), + new Route(POST, "/{index}/_aliases/{name}"), + new Route(PUT, "/{index}/_aliases/{name}"), + new Route(POST, "/_aliases/{name}"), + new Route(PUT, "/_aliases/{name}"), + new Route(PUT, "/{index}/_alias"), + new Route(PUT, "/{index}/_aliases"), + new Route(PUT, "/_alias"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java index 076acd43cae34..133d2d7bde436 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesAliasesAction.java @@ -41,7 +41,7 @@ public String getName() { @Override public List handledRoutes() { - return singletonList(new Route("/_aliases", POST)); + return singletonList(new Route(POST, "/_aliases")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java index ceee6155f1a95..3f2bd944ae410 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesSegmentsAction.java @@ -39,8 +39,8 @@ public class RestIndicesSegmentsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_segments", GET), - new Route("/{index}/_segments", GET))); + new Route(GET, "/_segments"), + new Route(GET, "/{index}/_segments"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java index 67794e3f5b8f5..d0565c9dcfe69 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesShardStoresAction.java @@ -48,8 +48,8 @@ public class RestIndicesShardStoresAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_shard_stores", GET), - new Route("/{index}/_shard_stores", GET))); + new Route(GET, "/_shard_stores"), + new Route(GET, "/{index}/_shard_stores"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesStatsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesStatsAction.java index dcae0372613e1..94e037696a82d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesStatsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestIndicesStatsAction.java @@ -48,10 +48,10 @@ public class RestIndicesStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_stats", GET), - new Route("/_stats/{metric}", GET), - new Route("/{index}/_stats", GET), - new Route("/{index}/_stats/{metric}", GET))); + new Route(GET, "/_stats"), + new Route(GET, "/_stats/{metric}"), + new Route(GET, "/{index}/_stats"), + new Route(GET, "/{index}/_stats/{metric}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestOpenIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestOpenIndexAction.java index 16f65bc3b5df3..3363f5d0f409a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestOpenIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestOpenIndexAction.java @@ -40,8 +40,8 @@ public class RestOpenIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_open", POST), - new Route("/{index}/_open", POST))); + new Route(POST, "/_open"), + new Route(POST, "/{index}/_open"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java index a3a6dac7a5820..41620b744027c 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutIndexTemplateAction.java @@ -41,8 +41,8 @@ public class RestPutIndexTemplateAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_template/{name}", POST), - new Route("/_template/{name}", PUT))); + new Route(POST, "/_template/{name}"), + new Route(PUT, "/_template/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java index de837f1fa9e97..0ee08b3cb8774 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java @@ -44,10 +44,10 @@ public class RestPutMappingAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_mapping/", POST), - new Route("/{index}/_mapping/", PUT), - new Route("/{index}/_mappings/", POST), - new Route("/{index}/_mappings/", PUT))); + new Route(POST, "/{index}/_mapping/"), + new Route(PUT, "/{index}/_mapping/"), + new Route(POST, "/{index}/_mappings/"), + new Route(PUT, "/{index}/_mappings/"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRecoveryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRecoveryAction.java index c908c143a2e22..793d3c9d23e76 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRecoveryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRecoveryAction.java @@ -42,8 +42,8 @@ public class RestRecoveryAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_recovery", GET), - new Route("/{index}/_recovery", GET))); + new Route(GET, "/_recovery"), + new Route(GET, "/{index}/_recovery"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRefreshAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRefreshAction.java index 5f052cab74f93..52bc5df327de8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRefreshAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRefreshAction.java @@ -42,10 +42,10 @@ public class RestRefreshAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_refresh", GET), - new Route("/_refresh", POST), - new Route("/{index}/_refresh", GET), - new Route("/{index}/_refresh", POST))); + new Route(GET, "/_refresh"), + new Route(POST, "/_refresh"), + new Route(GET, "/{index}/_refresh"), + new Route(POST, "/{index}/_refresh"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java index 756d317979b53..9d1cfd6318cb5 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestResizeHandler.java @@ -61,8 +61,8 @@ public static class RestShrinkIndexAction extends RestResizeHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_shrink/{target}", POST), - new Route("/{index}/_shrink/{target}", PUT))); + new Route(POST, "/{index}/_shrink/{target}"), + new Route(PUT, "/{index}/_shrink/{target}"))); } @Override @@ -82,8 +82,8 @@ public static class RestSplitIndexAction extends RestResizeHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_split/{target}", POST), - new Route("/{index}/_split/{target}", PUT))); + new Route(POST, "/{index}/_split/{target}"), + new Route(PUT, "/{index}/_split/{target}"))); } @Override @@ -103,8 +103,8 @@ public static class RestCloneIndexAction extends RestResizeHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_clone/{target}", POST), - new Route("/{index}/_clone/{target}", PUT))); + new Route(POST, "/{index}/_clone/{target}"), + new Route(PUT, "/{index}/_clone/{target}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java index e2e083a5f3aac..08397c7c077c6 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestRolloverIndexAction.java @@ -38,8 +38,8 @@ public class RestRolloverIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_rollover", POST), - new Route("/{index}/_rollover/{new_index}", POST))); + new Route(POST, "/{index}/_rollover"), + new Route(POST, "/{index}/_rollover/{new_index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java index 0fc8a9fbdedad..a8db872534bbb 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestSyncedFlushAction.java @@ -52,10 +52,10 @@ public class RestSyncedFlushAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_flush/synced", GET), - new Route("/_flush/synced", POST), - new Route("/{index}/_flush/synced", GET), - new Route("/{index}/_flush/synced", POST))); + new Route(GET, "/_flush/synced"), + new Route(POST, "/_flush/synced"), + new Route(GET, "/{index}/_flush/synced"), + new Route(POST, "/{index}/_flush/synced"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpdateSettingsAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpdateSettingsAction.java index e313d6c920963..c02eb6ec3a3ec 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpdateSettingsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpdateSettingsAction.java @@ -42,8 +42,8 @@ public class RestUpdateSettingsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_settings", PUT), - new Route("/_settings", PUT))); + new Route(PUT, "/{index}/_settings"), + new Route(PUT, "/_settings"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeActionDeprecated.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeActionDeprecated.java index 962d74b8252bc..52307b0f33c66 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeActionDeprecated.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeActionDeprecated.java @@ -48,8 +48,8 @@ public class RestUpgradeActionDeprecated extends BaseRestHandler { @Override public List deprecatedRoutes() { return unmodifiableList(asList( - new DeprecatedRoute("/_upgrade", POST, UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger), - new DeprecatedRoute("/{index}/_upgrade", POST, UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger))); + new DeprecatedRoute(POST, "/_upgrade", UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger), + new DeprecatedRoute(POST, "/{index}/_upgrade", UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeStatusActionDeprecated.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeStatusActionDeprecated.java index d9169efd7a8d5..36d97986884d9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeStatusActionDeprecated.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestUpgradeStatusActionDeprecated.java @@ -46,8 +46,8 @@ public class RestUpgradeStatusActionDeprecated extends BaseRestHandler { @Override public List deprecatedRoutes() { return unmodifiableList(asList( - new DeprecatedRoute("/_upgrade", GET, UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger), - new DeprecatedRoute("/{index}/_upgrade", GET, UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger))); + new DeprecatedRoute(GET, "/_upgrade", UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger), + new DeprecatedRoute(GET, "/{index}/_upgrade", UPGRADE_API_DEPRECATION_MESSAGE, deprecationLogger))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java index 203e20c0028d2..162d6591e2184 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestValidateQueryAction.java @@ -48,10 +48,10 @@ public class RestValidateQueryAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_validate/query", GET), - new Route("/_validate/query", POST), - new Route("/{index}/_validate/query", GET), - new Route("/{index}/_validate/query", POST))); + new Route(GET, "/_validate/query"), + new Route(POST, "/_validate/query"), + new Route(GET, "/{index}/_validate/query"), + new Route(POST, "/{index}/_validate/query"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java index 805a41a5827c9..90356ca291ae3 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestAliasAction.java @@ -40,8 +40,8 @@ public class RestAliasAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/aliases", GET), - new Route("/_cat/aliases/{alias}", GET))); + new Route(GET, "/_cat/aliases"), + new Route(GET, "/_cat/aliases/{alias}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java index 40005cc803f6e..7f1ca267a2c55 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java @@ -49,8 +49,8 @@ public class RestAllocationAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/allocation", GET), - new Route("/_cat/allocation/{nodes}", GET))); + new Route(GET, "/_cat/allocation"), + new Route(GET, "/_cat/allocation/{nodes}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatAction.java index 625797c8902e4..45a1d09bac535 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatAction.java @@ -48,7 +48,7 @@ public RestCatAction(List catActions) { @Override public List handledRoutes() { - return singletonList(new Route("/_cat", GET)); + return singletonList(new Route(GET, "/_cat")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatRecoveryAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatRecoveryAction.java index 19b54dec4de50..2d9f5774800b9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatRecoveryAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCatRecoveryAction.java @@ -54,8 +54,8 @@ public class RestCatRecoveryAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/recovery", GET), - new Route("/_cat/recovery/{index}", GET))); + new Route(GET, "/_cat/recovery"), + new Route(GET, "/_cat/recovery/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java index 68fc996252f0b..8ccb295ca0fda 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestCountAction.java @@ -45,8 +45,8 @@ public class RestCountAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/count", GET), - new Route("/_cat/count/{index}", GET))); + new Route(GET, "/_cat/count"), + new Route(GET, "/_cat/count/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java index 42d8eedee437c..2909471f48156 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java @@ -44,8 +44,8 @@ public class RestFielddataAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/fielddata", GET), - new Route("/_cat/fielddata/{fields}", GET))); + new Route(GET, "/_cat/fielddata"), + new Route(GET, "/_cat/fielddata/{fields}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestHealthAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestHealthAction.java index 0adec09a4c2ec..6971015de1beb 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestHealthAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestHealthAction.java @@ -37,7 +37,7 @@ public class RestHealthAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/health", GET)); + return singletonList(new Route(GET, "/_cat/health")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java index 8c8e27635a339..72050525dcfb8 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java @@ -73,8 +73,8 @@ public class RestIndicesAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/indices", GET), - new Route("/_cat/indices/{index}", GET))); + new Route(GET, "/_cat/indices"), + new Route(GET, "/_cat/indices/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestMasterAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestMasterAction.java index b127f25cd68d3..040f6bfd0474b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestMasterAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestMasterAction.java @@ -38,7 +38,7 @@ public class RestMasterAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/master", GET)); + return singletonList(new Route(GET, "/_cat/master")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodeAttrsAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodeAttrsAction.java index 71a39bef2ba40..e8ae2c924dcf3 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodeAttrsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodeAttrsAction.java @@ -44,7 +44,7 @@ public class RestNodeAttrsAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/nodeattrs", GET)); + return singletonList(new Route(GET, "/_cat/nodeattrs")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java index 53230d97d6bd2..fbe82d847a1ba 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java @@ -72,7 +72,7 @@ public class RestNodesAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/nodes", GET)); + return singletonList(new Route(GET, "/_cat/nodes")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestPendingClusterTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestPendingClusterTasksAction.java index cd78abcf37d8f..4ecad5ec2060d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestPendingClusterTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestPendingClusterTasksAction.java @@ -37,7 +37,7 @@ public class RestPendingClusterTasksAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/pending_tasks", GET)); + return singletonList(new Route(GET, "/_cat/pending_tasks")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java index 841e1e98390c4..ee7552647721e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestPluginsAction.java @@ -43,7 +43,7 @@ public class RestPluginsAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/plugins", GET)); + return singletonList(new Route(GET, "/_cat/plugins")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestRepositoriesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestRepositoriesAction.java index 0e0dcfdfe5827..d913c042dc13d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestRepositoriesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestRepositoriesAction.java @@ -40,7 +40,7 @@ public class RestRepositoriesAction extends AbstractCatAction { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/repositories", GET)); + return singletonList(new Route(GET, "/_cat/repositories")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java index b604c6135e30b..e66862b594150 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestSegmentsAction.java @@ -48,8 +48,8 @@ public class RestSegmentsAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/segments", GET), - new Route("/_cat/segments/{index}", GET))); + new Route(GET, "/_cat/segments"), + new Route(GET, "/_cat/segments/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java index 6f07cd7f14b2f..cd0cf91d63967 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java @@ -64,8 +64,8 @@ public class RestShardsAction extends AbstractCatAction { @Override public List handledRoutes() { - return unmodifiableList(asList(new Route("/_cat/shards", GET), - new Route("/_cat/shards/{index}", GET))); + return unmodifiableList(asList(new Route(GET, "/_cat/shards"), + new Route(GET, "/_cat/shards/{index}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestSnapshotAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestSnapshotAction.java index 104b043fdcc16..91c95a50a27bc 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestSnapshotAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestSnapshotAction.java @@ -52,8 +52,8 @@ public class RestSnapshotAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/snapshots", GET), - new Route("/_cat/snapshots/{repository}", GET))); + new Route(GET, "/_cat/snapshots"), + new Route(GET, "/_cat/snapshots/{repository}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTasksAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTasksAction.java index b5115962ab40a..86dc518de7c8d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTasksAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTasksAction.java @@ -56,7 +56,7 @@ public RestTasksAction(Supplier nodesInCluster) { @Override public List handledRoutes() { - return singletonList(new Route("/_cat/tasks", GET)); + return singletonList(new Route(GET, "/_cat/tasks")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java index 044c8c78cc239..3622d7529e70b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestTemplatesAction.java @@ -42,8 +42,8 @@ public class RestTemplatesAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/templates", GET), - new Route("/_cat/templates/{name}", GET))); + new Route(GET, "/_cat/templates"), + new Route(GET, "/_cat/templates/{name}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java b/server/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java index d9c63e264c9a4..c0b717380315f 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java @@ -56,8 +56,8 @@ public class RestThreadPoolAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_cat/thread_pool", GET), - new Route("/_cat/thread_pool/{thread_pool_patterns}", GET))); + new Route(GET, "/_cat/thread_pool"), + new Route(GET, "/_cat/thread_pool/{thread_pool_patterns}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java index 79d2708096cbd..88813c8878a15 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestBulkAction.java @@ -58,10 +58,10 @@ public RestBulkAction(Settings settings) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_bulk", POST), - new Route("/_bulk", PUT), - new Route("/{index}/_bulk", POST), - new Route("/{index}/_bulk", PUT))); + new Route(POST, "/_bulk"), + new Route(PUT, "/_bulk"), + new Route(POST, "/{index}/_bulk"), + new Route(PUT, "/{index}/_bulk"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java index 4cd8796e80c9f..a0de9d9928a9a 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestDeleteAction.java @@ -38,7 +38,7 @@ public class RestDeleteAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_doc/{id}", DELETE)); + return singletonList(new Route(DELETE, "/{index}/_doc/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java index 67a5927f99f62..11eb6575b60b2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java @@ -51,8 +51,8 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_doc/{id}", GET), - new Route("/{index}/_doc/{id}", HEAD))); + new Route(GET, "/{index}/_doc/{id}"), + new Route(HEAD, "/{index}/_doc/{id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java index 59fbef33a6ddf..cf0e92a5627dc 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java @@ -53,8 +53,8 @@ public class RestGetSourceAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_source/{id}", GET), - new Route("/{index}/_source/{id}", HEAD))); + new Route(GET, "/{index}/_source/{id}"), + new Route(HEAD, "/{index}/_source/{id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java index 11128bcf2046d..e2de8fdea410b 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestIndexAction.java @@ -45,8 +45,8 @@ public class RestIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_doc/{id}", POST), - new Route("/{index}/_doc/{id}", PUT))); + new Route(POST, "/{index}/_doc/{id}"), + new Route(PUT, "/{index}/_doc/{id}"))); } @Override @@ -64,8 +64,8 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_create/{id}", POST), - new Route("/{index}/_create/{id}", PUT))); + new Route(POST, "/{index}/_create/{id}"), + new Route(PUT, "/{index}/_create/{id}"))); } @Override @@ -97,7 +97,7 @@ public String getName() { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_doc", POST)); + return singletonList(new Route(POST, "/{index}/_doc")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java index 48fd1ac3d35d3..c5554981107bf 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiGetAction.java @@ -48,10 +48,10 @@ public RestMultiGetAction(Settings settings) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_mget", GET), - new Route("/_mget", POST), - new Route("/{index}/_mget", GET), - new Route("/{index}/_mget", POST))); + new Route(GET, "/_mget"), + new Route(POST, "/_mget"), + new Route(GET, "/{index}/_mget"), + new Route(POST, "/{index}/_mget"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java index 0edf24547cebd..42279e7a75b77 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java @@ -40,10 +40,10 @@ public class RestMultiTermVectorsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_mtermvectors", GET), - new Route("/_mtermvectors", POST), - new Route("/{index}/_mtermvectors", GET), - new Route("/{index}/_mtermvectors", POST))); + new Route(GET, "/_mtermvectors"), + new Route(POST, "/_mtermvectors"), + new Route(GET, "/{index}/_mtermvectors"), + new Route(POST, "/{index}/_mtermvectors"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java index 566b988ec9266..51deaa01ea837 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java @@ -48,10 +48,10 @@ public class RestTermVectorsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_termvectors", GET), - new Route("/{index}/_termvectors", POST), - new Route("/{index}/_termvectors/{id}", GET), - new Route("/{index}/_termvectors/{id}", POST))); + new Route(GET, "/{index}/_termvectors"), + new Route(POST, "/{index}/_termvectors"), + new Route(GET, "/{index}/_termvectors/{id}"), + new Route(POST, "/{index}/_termvectors/{id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java index de744f255cc8a..af1b99283e609 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/document/RestUpdateAction.java @@ -41,7 +41,7 @@ public class RestUpdateAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_update/{id}", POST)); + return singletonList(new Route(POST, "/{index}/_update/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestDeletePipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestDeletePipelineAction.java index 0849a9b4bd661..1543a39bf5e6d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestDeletePipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestDeletePipelineAction.java @@ -34,7 +34,7 @@ public class RestDeletePipelineAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ingest/pipeline/{id}", DELETE)); + return singletonList(new Route(DELETE, "/_ingest/pipeline/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestGetPipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestGetPipelineAction.java index e23af78a01c22..6a5617a48f4c2 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestGetPipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestGetPipelineAction.java @@ -38,8 +38,8 @@ public class RestGetPipelineAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_ingest/pipeline", GET), - new Route("/_ingest/pipeline/{id}", GET))); + new Route(GET, "/_ingest/pipeline"), + new Route(GET, "/_ingest/pipeline/{id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java index ea4cd85c5c429..173311e89e65e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestPutPipelineAction.java @@ -39,7 +39,7 @@ public class RestPutPipelineAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ingest/pipeline/{id}", PUT)); + return singletonList(new Route(PUT, "/_ingest/pipeline/{id}")); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java index dfe5de212d38e..36e0d9f89606e 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/ingest/RestSimulatePipelineAction.java @@ -41,10 +41,10 @@ public class RestSimulatePipelineAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_ingest/pipeline/{id}/_simulate", GET), - new Route("/_ingest/pipeline/{id}/_simulate", POST), - new Route("/_ingest/pipeline/_simulate", GET), - new Route("/_ingest/pipeline/_simulate", POST))); + new Route(GET, "/_ingest/pipeline/{id}/_simulate"), + new Route(POST, "/_ingest/pipeline/{id}/_simulate"), + new Route(GET, "/_ingest/pipeline/_simulate"), + new Route(POST, "/_ingest/pipeline/_simulate"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestClearScrollAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestClearScrollAction.java index 97a413c1584ef..65b5bb959a991 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestClearScrollAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestClearScrollAction.java @@ -38,8 +38,8 @@ public class RestClearScrollAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_search/scroll", DELETE), - new Route("/_search/scroll/{scroll_id}", DELETE))); + new Route(DELETE, "/_search/scroll"), + new Route(DELETE, "/_search/scroll/{scroll_id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java index c1fe8edafc958..c3d258512609d 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestCountAction.java @@ -49,10 +49,10 @@ public class RestCountAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_count", GET), - new Route("/_count", POST), - new Route("/{index}/_count", GET), - new Route("/{index}/_count", POST))); + new Route(GET, "/_count"), + new Route(POST, "/_count"), + new Route(GET, "/{index}/_count"), + new Route(POST, "/{index}/_count"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java index 5299a9fde31ce..494f137cb1387 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestExplainAction.java @@ -45,8 +45,8 @@ public class RestExplainAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_explain/{id}", GET), - new Route("/{index}/_explain/{id}", POST))); + new Route(GET, "/{index}/_explain/{id}"), + new Route(POST, "/{index}/_explain/{id}"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java index 0e20ff4f0bb4a..93f1f856de7e9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java @@ -68,10 +68,10 @@ public RestMultiSearchAction(Settings settings) { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_msearch", GET), - new Route("/_msearch", POST), - new Route("/{index}/_msearch", GET), - new Route("/{index}/_msearch", POST))); + new Route(GET, "/_msearch"), + new Route(POST, "/_msearch"), + new Route(GET, "/{index}/_msearch"), + new Route(POST, "/{index}/_msearch"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java index c646fa36c3306..1eab74a1bd5f9 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java @@ -78,10 +78,10 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_search", GET), - new Route("/_search", POST), - new Route("/{index}/_search", GET), - new Route("/{index}/_search", POST))); + new Route(GET, "/_search"), + new Route(POST, "/_search"), + new Route(GET, "/{index}/_search"), + new Route(POST, "/{index}/_search"))); } @Override diff --git a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchScrollAction.java b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchScrollAction.java index 81e8561e14c00..8ec72a62937ef 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchScrollAction.java +++ b/server/src/main/java/org/elasticsearch/rest/action/search/RestSearchScrollAction.java @@ -48,10 +48,10 @@ public String getName() { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_search/scroll", GET), - new Route("/_search/scroll", POST), - new Route("/_search/scroll/{scroll_id}", GET), - new Route("/_search/scroll/{scroll_id}", POST))); + new Route(GET, "/_search/scroll"), + new Route(POST, "/_search/scroll"), + new Route(GET, "/_search/scroll/{scroll_id}"), + new Route(POST, "/_search/scroll/{scroll_id}"))); } @Override diff --git a/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java b/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java index 247da38d09fc9..5d70a0c98f7bf 100644 --- a/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java +++ b/server/src/test/java/org/elasticsearch/action/ActionModuleTests.java @@ -120,7 +120,7 @@ public void handleRequest(RestRequest request, RestChannel channel, NodeClient c @Override public List handledRoutes() { - return singletonList(new Route("/", Method.GET)); + return singletonList(new Route(Method.GET, "/")); } })); assertThat(e.getMessage(), startsWith("Cannot replace existing handler for [/] for method: GET")); @@ -153,7 +153,7 @@ public void testPluginCanRegisterRestHandler() { class FakeHandler implements RestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_dummy", Method.GET)); + return singletonList(new Route(Method.GET, "/_dummy")); } @Override @@ -186,7 +186,7 @@ public void handleRequest(RestRequest request, RestChannel channel, NodeClient c @Override public List handledRoutes() { - return singletonList(new Route("/_dummy", Method.GET)); + return singletonList(new Route(Method.GET, "/_dummy")); } })); assertThat(e.getMessage(), startsWith("Cannot replace existing handler for [/_dummy] for method: GET")); diff --git a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestGetAutoscalingDecisionHandler.java b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestGetAutoscalingDecisionHandler.java index 6da492a3f3277..2164065eae406 100644 --- a/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestGetAutoscalingDecisionHandler.java +++ b/x-pack/plugin/autoscaling/src/main/java/org/elasticsearch/xpack/autoscaling/rest/RestGetAutoscalingDecisionHandler.java @@ -21,7 +21,7 @@ public class RestGetAutoscalingDecisionHandler extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_autoscaling/decision", GET)); + return singletonList(new Route(GET, "/_autoscaling/decision")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestCcrStatsAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestCcrStatsAction.java index 7c41f5d7b2410..f22368b3e442d 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestCcrStatsAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestCcrStatsAction.java @@ -21,7 +21,7 @@ public class RestCcrStatsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ccr/stats", GET)); + return singletonList(new Route(GET, "/_ccr/stats")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestDeleteAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestDeleteAutoFollowPatternAction.java index 5519f281fa6d1..ece99212dab10 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestDeleteAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestDeleteAutoFollowPatternAction.java @@ -21,7 +21,7 @@ public class RestDeleteAutoFollowPatternAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ccr/auto_follow/{name}", DELETE)); + return singletonList(new Route(DELETE, "/_ccr/auto_follow/{name}")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowInfoAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowInfoAction.java index ebad7c2e7016b..077dd190dc3d9 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowInfoAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowInfoAction.java @@ -22,7 +22,7 @@ public class RestFollowInfoAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/info", GET)); + return singletonList(new Route(GET, "/{index}/_ccr/info")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowStatsAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowStatsAction.java index 26bc2edc220bc..030ae367fa87f 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowStatsAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestFollowStatsAction.java @@ -22,7 +22,7 @@ public class RestFollowStatsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/stats", GET)); + return singletonList(new Route(GET, "/{index}/_ccr/stats")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java index 20eed34c6f3de..ee8c79ff2c374 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestForgetFollowerAction.java @@ -24,7 +24,7 @@ public class RestForgetFollowerAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/forget_follower", POST)); + return singletonList(new Route(POST, "/{index}/_ccr/forget_follower")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestGetAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestGetAutoFollowPatternAction.java index 67e5c8b1b49d5..75f63ece47233 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestGetAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestGetAutoFollowPatternAction.java @@ -23,8 +23,8 @@ public class RestGetAutoFollowPatternAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_ccr/auto_follow/{name}", GET), - new Route("/_ccr/auto_follow", GET))); + new Route(GET, "/_ccr/auto_follow/{name}"), + new Route(GET, "/_ccr/auto_follow"))); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseAutoFollowPatternAction.java index a1adb12ad6c57..6e5e6f8648b66 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseAutoFollowPatternAction.java @@ -21,7 +21,7 @@ public class RestPauseAutoFollowPatternAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ccr/auto_follow/{name}/pause", POST)); + return singletonList(new Route(POST, "/_ccr/auto_follow/{name}/pause")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseFollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseFollowAction.java index 7cee2e1320170..669c412b80696 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseFollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPauseFollowAction.java @@ -21,7 +21,7 @@ public class RestPauseFollowAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/pause_follow", POST)); + return singletonList(new Route(POST, "/{index}/_ccr/pause_follow")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java index e4ec9887607f5..cc411f47d3b1f 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutAutoFollowPatternAction.java @@ -23,7 +23,7 @@ public class RestPutAutoFollowPatternAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ccr/auto_follow/{name}", PUT)); + return singletonList(new Route(PUT, "/_ccr/auto_follow/{name}")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java index 86b90ca9ab97e..128464ca0ffb2 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestPutFollowAction.java @@ -24,7 +24,7 @@ public class RestPutFollowAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/follow", PUT)); + return singletonList(new Route(PUT, "/{index}/_ccr/follow")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeAutoFollowPatternAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeAutoFollowPatternAction.java index a31660bbd1172..1c321e5768e3e 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeAutoFollowPatternAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeAutoFollowPatternAction.java @@ -21,7 +21,7 @@ public class RestResumeAutoFollowPatternAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ccr/auto_follow/{name}/resume", POST)); + return singletonList(new Route(POST, "/_ccr/auto_follow/{name}/resume")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java index 8a3f05636dba6..53547999ac7a7 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestResumeFollowAction.java @@ -23,7 +23,7 @@ public class RestResumeFollowAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/resume_follow", POST)); + return singletonList(new Route(POST, "/{index}/_ccr/resume_follow")); } @Override diff --git a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestUnfollowAction.java b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestUnfollowAction.java index e3498d70a01ba..35b037bec4acc 100644 --- a/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestUnfollowAction.java +++ b/x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/rest/RestUnfollowAction.java @@ -22,7 +22,7 @@ public class RestUnfollowAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ccr/unfollow", POST)); + return singletonList(new Route(POST, "/{index}/_ccr/unfollow")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java index 58351c3704793..554f3da36f450 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestDeleteLicenseAction.java @@ -24,7 +24,7 @@ public class RestDeleteLicenseAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license", DELETE)); + return singletonList(new Route(DELETE, "/_license")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java index ddafdca84a6ba..ac48fc981fa0d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetBasicStatus.java @@ -22,7 +22,7 @@ public class RestGetBasicStatus extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license/basic_status", GET)); + return singletonList(new Route(GET, "/_license/basic_status")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java index edba7c14729ae..85ca1e061e135 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java @@ -36,7 +36,7 @@ public class RestGetLicenseAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license", GET)); + return singletonList(new Route(GET, "/_license")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java index bd0584ae39285..29d046436bf38 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetTrialStatus.java @@ -22,7 +22,7 @@ public class RestGetTrialStatus extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license/trial_status", GET)); + return singletonList(new Route(GET, "/_license/trial_status")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java index 40d58a215ff2c..792a9705f26e1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartBasicLicense.java @@ -23,7 +23,7 @@ public class RestPostStartBasicLicense extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license/start_basic", POST)); + return singletonList(new Route(POST, "/_license/start_basic")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java index 7753acd330686..bf5430a7c8303 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPostStartTrialLicense.java @@ -27,7 +27,7 @@ public class RestPostStartTrialLicense extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_license/start_trial", POST)); + return singletonList(new Route(POST, "/_license/start_trial")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java index 21827743bc563..f6be2e4229c34 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestPutLicenseAction.java @@ -27,8 +27,8 @@ public class RestPutLicenseAction extends BaseRestHandler { public List handledRoutes() { // TODO: remove POST endpoint? return unmodifiableList(asList( - new Route("/_license", POST), - new Route("/_license", PUT))); + new Route(POST, "/_license"), + new Route(PUT, "/_license"))); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestReloadAnalyzersAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestReloadAnalyzersAction.java index 04c74e354b8b0..d4f957f22e9e2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestReloadAnalyzersAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestReloadAnalyzersAction.java @@ -27,8 +27,8 @@ public class RestReloadAnalyzersAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_reload_search_analyzers", GET), - new Route("/{index}/_reload_search_analyzers", POST))); + new Route(GET, "/{index}/_reload_search_analyzers"), + new Route(POST, "/{index}/_reload_search_analyzers"))); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java index 0ea34bc6ae43c..c80b35c0f1939 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java @@ -26,8 +26,8 @@ public class RestXPackInfoAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_xpack", GET), - new Route("/_xpack", HEAD))); + new Route(GET, "/_xpack"), + new Route(HEAD, "/_xpack"))); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java index 4b89d4789583c..3eb6570674758 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackUsageAction.java @@ -29,7 +29,7 @@ public class RestXPackUsageAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_xpack/usage", GET)); + return singletonList(new Route(GET, "/_xpack/usage")); } @Override diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java index e5efc7f17010d..56a2ad1669397 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/rest/RestGetCertificateInfoAction.java @@ -29,7 +29,7 @@ public class RestGetCertificateInfoAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ssl/certificates", GET)); + return singletonList(new Route(GET, "/_ssl/certificates")); } @Override diff --git a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java index dd8a4757f40dd..cc45effd94ef2 100644 --- a/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java +++ b/x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/RestDeprecationInfoAction.java @@ -25,8 +25,8 @@ public class RestDeprecationInfoAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_migration/deprecations", GET), - new Route("/{index}/_migration/deprecations", GET))); + new Route(GET, "/_migration/deprecations"), + new Route(GET, "/{index}/_migration/deprecations"))); } @Override diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestDeleteEnrichPolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestDeleteEnrichPolicyAction.java index cc42d96763944..57ad67c4cdb10 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestDeleteEnrichPolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestDeleteEnrichPolicyAction.java @@ -21,7 +21,7 @@ public class RestDeleteEnrichPolicyAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_enrich/policy/{name}", DELETE)); + return singletonList(new Route(DELETE, "/_enrich/policy/{name}")); } @Override diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestEnrichStatsAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestEnrichStatsAction.java index 01ac4eb751e58..8727be5cb56c3 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestEnrichStatsAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestEnrichStatsAction.java @@ -21,7 +21,7 @@ public class RestEnrichStatsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_enrich/_stats", GET)); + return singletonList(new Route(GET, "/_enrich/_stats")); } @Override diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestExecuteEnrichPolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestExecuteEnrichPolicyAction.java index 63066d1b56bf7..d944b5a0b3111 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestExecuteEnrichPolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestExecuteEnrichPolicyAction.java @@ -24,7 +24,7 @@ public class RestExecuteEnrichPolicyAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList( - asList(new Route("/_enrich/policy/{name}/_execute", POST), new Route("/_enrich/policy/{name}/_execute", PUT)) + asList(new Route(POST, "/_enrich/policy/{name}/_execute"), new Route(PUT, "/_enrich/policy/{name}/_execute")) ); } diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestGetEnrichPolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestGetEnrichPolicyAction.java index c2f5ca9fd6adf..3c146a5de1777 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestGetEnrichPolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestGetEnrichPolicyAction.java @@ -23,7 +23,7 @@ public class RestGetEnrichPolicyAction extends BaseRestHandler { @Override public List handledRoutes() { - return unmodifiableList(asList(new Route("/_enrich/policy/{name}", GET), new Route("/_enrich/policy", GET))); + return unmodifiableList(asList(new Route(GET, "/_enrich/policy/{name}"), new Route(GET, "/_enrich/policy"))); } @Override diff --git a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java index c2d2c3dce61c6..1ed51cbc7d384 100644 --- a/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java +++ b/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/rest/RestPutEnrichPolicyAction.java @@ -22,7 +22,7 @@ public class RestPutEnrichPolicyAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_enrich/policy/{name}", PUT)); + return singletonList(new Route(PUT, "/_enrich/policy/{name}")); } @Override diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java index 2091bc21365f0..1a4b23f6ec99f 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/plugin/RestEqlSearchAction.java @@ -34,8 +34,8 @@ public class RestEqlSearchAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(SEARCH_PATH, GET), - new Route(SEARCH_PATH, POST))); + new Route(GET, SEARCH_PATH), + new Route(POST, SEARCH_PATH))); } @Override diff --git a/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java b/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java index 558df47869290..aa7e941de32da 100644 --- a/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java +++ b/x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/rest/action/RestFreezeIndexAction.java @@ -26,8 +26,8 @@ public final class RestFreezeIndexAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_freeze", POST), - new Route("/{index}/_unfreeze", POST))); + new Route(POST, "/{index}/_freeze"), + new Route(POST, "/{index}/_unfreeze"))); } @Override diff --git a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java index b4dd46c404507..b6c6dbc22b391 100644 --- a/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java +++ b/x-pack/plugin/graph/src/main/java/org/elasticsearch/xpack/graph/rest/action/RestGraphAction.java @@ -61,8 +61,8 @@ public class RestGraphAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/{index}/_graph/explore", GET), - new Route("/{index}/_graph/explore", POST))); + new Route(GET, "/{index}/_graph/explore"), + new Route(POST, "/{index}/_graph/explore"))); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestDeleteLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestDeleteLifecycleAction.java index 5602686d44af7..221c39850d276 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestDeleteLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestDeleteLifecycleAction.java @@ -21,7 +21,7 @@ public class RestDeleteLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/policy/{name}", DELETE)); + return singletonList(new Route(DELETE, "/_ilm/policy/{name}")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestExplainLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestExplainLifecycleAction.java index da838842b6b88..50cbcca649de9 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestExplainLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestExplainLifecycleAction.java @@ -24,7 +24,7 @@ public class RestExplainLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ilm/explain", GET)); + return singletonList(new Route(GET, "/{index}/_ilm/explain")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetLifecycleAction.java index 333e90cc53ce0..f858af2632c79 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetLifecycleAction.java @@ -24,8 +24,8 @@ public class RestGetLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_ilm/policy", GET), - new Route("/_ilm/policy/{name}", GET))); + new Route(GET, "/_ilm/policy"), + new Route(GET, "/_ilm/policy/{name}"))); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetStatusAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetStatusAction.java index 41b92b5ae608a..0a7f0406322ce 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetStatusAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestGetStatusAction.java @@ -21,7 +21,7 @@ public class RestGetStatusAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/status", GET)); + return singletonList(new Route(GET, "/_ilm/status")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java index 6ffc34f84bbae..f1b19942b9608 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestMoveToStepAction.java @@ -24,7 +24,7 @@ public class RestMoveToStepAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/move/{name}", POST)); + return singletonList(new Route(POST, "/_ilm/move/{name}")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java index 1181e99bd7edf..493b7fd317a16 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestPutLifecycleAction.java @@ -23,7 +23,7 @@ public class RestPutLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/policy/{name}", PUT)); + return singletonList(new Route(PUT, "/_ilm/policy/{name}")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRemoveIndexLifecyclePolicyAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRemoveIndexLifecyclePolicyAction.java index 27b0dea7b4a8b..9fed8b0c10901 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRemoveIndexLifecyclePolicyAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRemoveIndexLifecyclePolicyAction.java @@ -23,7 +23,7 @@ public class RestRemoveIndexLifecyclePolicyAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ilm/remove", POST)); + return singletonList(new Route(POST, "/{index}/_ilm/remove")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRetryAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRetryAction.java index 55ce43f3283b2..c42c799d887c0 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRetryAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestRetryAction.java @@ -24,7 +24,7 @@ public class RestRetryAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_ilm/retry", POST)); + return singletonList(new Route(POST, "/{index}/_ilm/retry")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStartILMAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStartILMAction.java index bed7a4fae38f2..d1df3cbb0881c 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStartILMAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStartILMAction.java @@ -22,7 +22,7 @@ public class RestStartILMAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/start", POST)); + return singletonList(new Route(POST, "/_ilm/start")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStopAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStopAction.java index fe5f12d40fb55..befbd911d5449 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStopAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/action/RestStopAction.java @@ -22,7 +22,7 @@ public class RestStopAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_ilm/stop", POST)); + return singletonList(new Route(POST, "/_ilm/stop")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestDeleteSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestDeleteSnapshotLifecycleAction.java index c2cb848f7615c..f7cdd1a0463aa 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestDeleteSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestDeleteSnapshotLifecycleAction.java @@ -21,7 +21,7 @@ public class RestDeleteSnapshotLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/policy/{name}", DELETE)); + return singletonList(new Route(DELETE, "/_slm/policy/{name}")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotLifecycleAction.java index e5f6bd7e9355b..56c889901e610 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotLifecycleAction.java @@ -24,8 +24,8 @@ public class RestExecuteSnapshotLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_slm/policy/{name}/_execute", POST), - new Route("/_slm/policy/{name}/_execute", PUT))); + new Route(POST, "/_slm/policy/{name}/_execute"), + new Route(PUT, "/_slm/policy/{name}/_execute"))); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotRetentionAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotRetentionAction.java index 1acb00c2b0574..3c48edf3bb1f1 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotRetentionAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestExecuteSnapshotRetentionAction.java @@ -21,7 +21,7 @@ public class RestExecuteSnapshotRetentionAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/_execute_retention", POST)); + return singletonList(new Route(POST, "/_slm/_execute_retention")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSLMStatusAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSLMStatusAction.java index 32c99b3e57a67..34ffd979d7a06 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSLMStatusAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSLMStatusAction.java @@ -21,7 +21,7 @@ public class RestGetSLMStatusAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/status", GET)); + return singletonList(new Route(GET, "/_slm/status")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleAction.java index ab7325083fee8..31fdfa4f4e2f2 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleAction.java @@ -24,8 +24,8 @@ public class RestGetSnapshotLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_slm/policy", GET), - new Route("/_slm/policy/{name}", GET))); + new Route(GET, "/_slm/policy"), + new Route(GET, "/_slm/policy/{name}"))); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleStatsAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleStatsAction.java index bd1506fd5152f..b76340d90bc1b 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleStatsAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestGetSnapshotLifecycleStatsAction.java @@ -21,7 +21,7 @@ public class RestGetSnapshotLifecycleStatsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/stats", GET)); + return singletonList(new Route(GET, "/_slm/stats")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java index dcf649324992e..8fa8fafef2a2d 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestPutSnapshotLifecycleAction.java @@ -23,7 +23,7 @@ public class RestPutSnapshotLifecycleAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/policy/{name}", PUT)); + return singletonList(new Route(PUT, "/_slm/policy/{name}")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStartSLMAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStartSLMAction.java index 5d3f77f654732..8bb8d1d0ce086 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStartSLMAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStartSLMAction.java @@ -21,7 +21,7 @@ public class RestStartSLMAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/start", POST)); + return singletonList(new Route(POST, "/_slm/start")); } @Override diff --git a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStopSLMAction.java b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStopSLMAction.java index d09e33821e771..9a4c11d2c8672 100644 --- a/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStopSLMAction.java +++ b/x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/slm/action/RestStopSLMAction.java @@ -21,7 +21,7 @@ public class RestStopSLMAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_slm/stop", POST)); + return singletonList(new Route(POST, "/_slm/stop")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatDatafeedsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatDatafeedsAction.java index 7009de7cd3181..19967ab82146f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatDatafeedsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatDatafeedsAction.java @@ -30,8 +30,8 @@ public class RestCatDatafeedsAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("_cat/ml/datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}", GET), - new Route("_cat/ml/datafeeds", GET))); + new Route(GET, "_cat/ml/datafeeds/{" + DatafeedConfig.ID.getPreferredName() + "}"), + new Route(GET, "_cat/ml/datafeeds"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatJobsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatJobsAction.java index d82d50428f192..b826f9d644474 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatJobsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatJobsAction.java @@ -35,8 +35,8 @@ public class RestCatJobsAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("_cat/ml/anomaly_detectors/{" + Job.ID.getPreferredName() + "}", GET), - new Route("_cat/ml/anomaly_detectors", GET))); + new Route(GET, "_cat/ml/anomaly_detectors/{" + Job.ID.getPreferredName() + "}"), + new Route(GET, "_cat/ml/anomaly_detectors"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatTrainedModelsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatTrainedModelsAction.java index 80dde77a7ab87..b31fde9168763 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatTrainedModelsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/cat/RestCatTrainedModelsAction.java @@ -47,8 +47,8 @@ public class RestCatTrainedModelsAction extends AbstractCatAction { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("_cat/ml/trained_models", GET), - new Route("_cat/ml/trained_models/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}", GET))); + new Route(GET, "_cat/ml/trained_models"), + new Route(GET, "_cat/ml/trained_models/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestDeleteDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestDeleteDataFrameAnalyticsAction.java index a28aca5fa8c63..2b59cb43471e0 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestDeleteDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestDeleteDataFrameAnalyticsAction.java @@ -24,7 +24,7 @@ public class RestDeleteDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}", DELETE)); + new Route(DELETE, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestEvaluateDataFrameAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestEvaluateDataFrameAction.java index 344a34f3dbe72..d2bc547b7bc20 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestEvaluateDataFrameAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestEvaluateDataFrameAction.java @@ -22,7 +22,7 @@ public class RestEvaluateDataFrameAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(MachineLearning.BASE_PATH + "data_frame/_evaluate", POST)); + return singletonList(new Route(POST, MachineLearning.BASE_PATH + "data_frame/_evaluate")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestExplainDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestExplainDataFrameAnalyticsAction.java index 0795672c0991e..2c371be317239 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestExplainDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestExplainDataFrameAnalyticsAction.java @@ -32,12 +32,12 @@ public class RestExplainDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/_explain", GET), - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/_explain", POST), - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_explain", - GET), - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_explain", - POST))); + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics/_explain"), + new Route(POST, MachineLearning.BASE_PATH + "data_frame/analytics/_explain"), + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_explain" + ), + new Route(POST, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_explain" + ))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsAction.java index e0b0075aad2a9..5a6ba13533b7f 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsAction.java @@ -27,8 +27,8 @@ public class RestGetDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics", GET), - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}", GET))); + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics"), + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsStatsAction.java index c3d418fc0c40d..21bee38a34336 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestGetDataFrameAnalyticsStatsAction.java @@ -27,9 +27,9 @@ public class RestGetDataFrameAnalyticsStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/_stats", GET), - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_stats", - GET))); + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics/_stats"), + new Route(GET, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_stats" + ))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java index 13ef23240b80a..f2764160773ef 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestPutDataFrameAnalyticsAction.java @@ -25,7 +25,7 @@ public class RestPutDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}", PUT)); + new Route(PUT, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStartDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStartDataFrameAnalyticsAction.java index f099002925e5f..e8ee2c6fb0be4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStartDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStartDataFrameAnalyticsAction.java @@ -25,8 +25,8 @@ public class RestStartDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_start", - POST)); + new Route(POST, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_start" + )); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStopDataFrameAnalyticsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStopDataFrameAnalyticsAction.java index 5260359b57653..38ce2954738d1 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStopDataFrameAnalyticsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/dataframe/RestStopDataFrameAnalyticsAction.java @@ -24,8 +24,8 @@ public class RestStopDataFrameAnalyticsAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_stop", - POST)); + new Route(POST, MachineLearning.BASE_PATH + "data_frame/analytics/{" + DataFrameAnalyticsConfig.ID.getPreferredName() + "}/_stop" + )); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestDeleteTrainedModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestDeleteTrainedModelAction.java index 2709b1ad7cbb1..50394e2ae757d 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestDeleteTrainedModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestDeleteTrainedModelAction.java @@ -24,7 +24,7 @@ public class RestDeleteTrainedModelAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}", DELETE)); + new Route(DELETE, MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java index 15292373baeb1..f0228c892e2b7 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsAction.java @@ -31,8 +31,8 @@ public class RestGetTrainedModelsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}", GET), - new Route(MachineLearning.BASE_PATH + "inference", GET))); + new Route(GET, MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}"), + new Route(GET, MachineLearning.BASE_PATH + "inference"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsStatsAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsStatsAction.java index d97fae9f664cc..050e846adc856 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsStatsAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestGetTrainedModelsStatsAction.java @@ -29,8 +29,8 @@ public class RestGetTrainedModelsStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}/_stats", GET), - new Route(MachineLearning.BASE_PATH + MachineLearning.BASE_PATH + "inference/_stats", GET))); + new Route(GET, MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}/_stats"), + new Route(GET, MachineLearning.BASE_PATH + MachineLearning.BASE_PATH + "inference/_stats"))); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java index ba536ede14709..f14228c3a5555 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/inference/RestPutTrainedModelAction.java @@ -25,7 +25,7 @@ public class RestPutTrainedModelAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}", PUT)); + new Route(PUT, MachineLearning.BASE_PATH + "inference/{" + TrainedModelConfig.MODEL_ID.getPreferredName() + "}")); } @Override diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java index be227b8f5ac1f..ce7daad41ced3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/rest/job/RestDeleteForecastAction.java @@ -31,7 +31,7 @@ public class RestDeleteForecastAction extends BaseRestHandler { @Override public List handledRoutes() { return singletonList( - new Route(MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_forecast/", DELETE)); + new Route(DELETE, MachineLearning.BASE_PATH + "anomaly_detectors/{" + Job.ID.getPreferredName() + "}/_forecast/")); } @Override diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java index db372c5fcaa84..dba11fba2cf21 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/rest/action/RestMonitoringBulkAction.java @@ -50,8 +50,8 @@ public class RestMonitoringBulkAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_monitoring/bulk", POST), - new Route("/_monitoring/bulk", PUT))); + new Route(POST, "/_monitoring/bulk"), + new Route(PUT, "/_monitoring/bulk"))); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java index 12fec56c5f22d..afadec1e580dc 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestDeleteRollupJobAction.java @@ -25,7 +25,7 @@ public class RestDeleteRollupJobAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/job/{id}", DELETE)); + return singletonList(new Route(DELETE, "/_rollup/job/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java index 5ae833455b6f4..b80cedf1b2789 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupCapsAction.java @@ -24,7 +24,7 @@ public class RestGetRollupCapsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/data/{id}", GET)); + return singletonList(new Route(GET, "/_rollup/data/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java index 54671b329a1c7..8ef597c7499f7 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupIndexCapsAction.java @@ -26,7 +26,7 @@ public class RestGetRollupIndexCapsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/{index}/_rollup/data", GET)); + return singletonList(new Route(GET, "/{index}/_rollup/data")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java index c89cba0e98dec..8139e4fb4c251 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestGetRollupJobsAction.java @@ -24,7 +24,7 @@ public class RestGetRollupJobsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/job/{id}", GET)); + return singletonList(new Route(GET, "/_rollup/job/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java index 0ca31c0440897..94c6926c3babf 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestPutRollupJobAction.java @@ -22,7 +22,7 @@ public class RestPutRollupJobAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/job/{id}", PUT)); + return singletonList(new Route(PUT, "/_rollup/job/{id}")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestRollupSearchAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestRollupSearchAction.java index a42e4c13609d9..87c965a2355c7 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestRollupSearchAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestRollupSearchAction.java @@ -29,10 +29,10 @@ public class RestRollupSearchAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("_rollup_search", GET), - new Route("_rollup_search", POST), - new Route("{index}/_rollup_search", GET), - new Route("{index}/_rollup_search", POST))); + new Route(GET, "_rollup_search"), + new Route(POST, "_rollup_search"), + new Route(GET, "{index}/_rollup_search"), + new Route(POST, "{index}/_rollup_search"))); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java index 0b65188f97f2d..03a4f0104ab06 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStartRollupJobAction.java @@ -22,7 +22,7 @@ public class RestStartRollupJobAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/job/{id}/_start", POST)); + return singletonList(new Route(POST, "/_rollup/job/{id}/_start")); } @Override diff --git a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java index 940c9b6ad5ae4..d18bf9fd53f17 100644 --- a/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java +++ b/x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/rest/RestStopRollupJobAction.java @@ -23,7 +23,7 @@ public class RestStopRollupJobAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_rollup/job/{id}/_stop", POST)); + return singletonList(new Route(POST, "/_rollup/job/{id}/_stop")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java index 36e85676d2c31..13084ae145614 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/RestDelegatePkiAuthenticationAction.java @@ -47,7 +47,7 @@ public RestDelegatePkiAuthenticationAction(Settings settings, XPackLicenseState @Override public List handledRoutes() { - return singletonList(new Route("/_security/delegate_pki", POST)); + return singletonList(new Route(POST, "/_security/delegate_pki")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyAction.java index f4a75b61f4356..02feee31cf08d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestCreateApiKeyAction.java @@ -40,8 +40,8 @@ public RestCreateApiKeyAction(Settings settings, XPackLicenseState licenseState) @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_security/api_key", POST), - new Route("/_security/api_key", PUT))); + new Route(POST, "/_security/api_key"), + new Route(PUT, "/_security/api_key"))); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java index 05f1fe0040ed2..6f094128904c6 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestGetApiKeyAction.java @@ -37,7 +37,7 @@ public RestGetApiKeyAction(Settings settings, XPackLicenseState licenseState) { @Override public List handledRoutes() { - return singletonList(new Route("/_security/api_key", GET)); + return singletonList(new Route(GET, "/_security/api_key")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java index 9ac2d17ff16ef..03daa16b7a180 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/apikey/RestInvalidateApiKeyAction.java @@ -52,7 +52,7 @@ public RestInvalidateApiKeyAction(Settings settings, XPackLicenseState licenseSt @Override public List handledRoutes() { - return singletonList(new Route("/_security/api_key", DELETE)); + return singletonList(new Route(DELETE, "/_security/api_key")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java index c09b7bcfa326d..ea5dffbe3635c 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectAuthenticateAction.java @@ -51,7 +51,7 @@ public RestOpenIdConnectAuthenticateAction(Settings settings, XPackLicenseState @Override public List handledRoutes() { - return singletonList(new Route("/_security/oidc/authenticate", POST)); + return singletonList(new Route(POST, "/_security/oidc/authenticate")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java index b590c6b4f95c1..1bcfbe750dd40 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectLogoutAction.java @@ -47,7 +47,7 @@ public RestOpenIdConnectLogoutAction(Settings settings, XPackLicenseState licens @Override public List handledRoutes() { - return singletonList(new Route("/_security/oidc/logout", POST)); + return singletonList(new Route(POST, "/_security/oidc/logout")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java index 2cf4adcb209c8..ad7a6bb801f95 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/oidc/RestOpenIdConnectPrepareAuthenticationAction.java @@ -52,7 +52,7 @@ public RestOpenIdConnectPrepareAuthenticationAction(Settings settings, XPackLice @Override public List handledRoutes() { - return singletonList(new Route("/_security/oidc/prepare", POST)); + return singletonList(new Route(POST, "/_security/oidc/prepare")); } @Override diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java index 83286bb329c79..0c754bba53285 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/rest/action/privilege/RestGetBuiltinPrivilegesAction.java @@ -36,7 +36,7 @@ public RestGetBuiltinPrivilegesAction(Settings settings, XPackLicenseState licen @Override public List handledRoutes() { - return singletonList(new Route("/_security/privilege/_builtin", GET)); + return singletonList(new Route(GET, "/_security/privilege/_builtin")); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java index f0be77701ea27..0c78c12f6a1d6 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlClearCursorAction.java @@ -25,7 +25,7 @@ public class RestSqlClearCursorAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(Protocol.CLEAR_CURSOR_REST_ENDPOINT, POST)); + return singletonList(new Route(POST, Protocol.CLEAR_CURSOR_REST_ENDPOINT)); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java index 0659d59c4e2a6..929a129455061 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlQueryAction.java @@ -36,8 +36,8 @@ public class RestSqlQueryAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(Protocol.SQL_QUERY_REST_ENDPOINT, GET), - new Route(Protocol.SQL_QUERY_REST_ENDPOINT, POST))); + new Route(GET, Protocol.SQL_QUERY_REST_ENDPOINT), + new Route(POST, Protocol.SQL_QUERY_REST_ENDPOINT))); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java index 3324d3058a81a..d0a5977ef9c6f 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlStatsAction.java @@ -21,7 +21,7 @@ public class RestSqlStatsAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(Protocol.SQL_STATS_REST_ENDPOINT, GET)); + return singletonList(new Route(GET, Protocol.SQL_STATS_REST_ENDPOINT)); } @Override diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java index 540028c4351ac..72371f55b1637 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/plugin/RestSqlTranslateAction.java @@ -30,8 +30,8 @@ public class RestSqlTranslateAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(Protocol.SQL_TRANSLATE_REST_ENDPOINT, GET), - new Route(Protocol.SQL_TRANSLATE_REST_ENDPOINT, POST))); + new Route(GET, Protocol.SQL_TRANSLATE_REST_ENDPOINT), + new Route(POST, Protocol.SQL_TRANSLATE_REST_ENDPOINT))); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformAction.java index f984fe071e5d4..6b3c990cec977 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestDeleteTransformAction.java @@ -22,7 +22,7 @@ public class RestDeleteTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID, DELETE)); + return singletonList(new Route(DELETE, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformAction.java index dca3534832cb1..2b7f41cdf6742 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformAction.java @@ -26,8 +26,8 @@ public class RestGetTransformAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(TransformField.REST_BASE_PATH_TRANSFORMS, GET), - new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID, GET))); + new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS), + new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID))); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformStatsAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformStatsAction.java index 772b6d8600a82..dc493349a7145 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformStatsAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestGetTransformStatsAction.java @@ -26,8 +26,8 @@ public class RestGetTransformStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route(TransformField.REST_BASE_PATH_TRANSFORMS + "_stats", GET), - new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_stats", GET))); + new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS + "_stats"), + new Route(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_stats"))); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPreviewTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPreviewTransformAction.java index 442d88865f89a..0a48d4c20bf72 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPreviewTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPreviewTransformAction.java @@ -24,7 +24,7 @@ public class RestPreviewTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS + "_preview", POST)); + return singletonList(new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS + "_preview")); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java index 91d6c5f5160b4..923c53395c29a 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestPutTransformAction.java @@ -24,7 +24,7 @@ public class RestPutTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID, PUT)); + return singletonList(new Route(PUT, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStartTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStartTransformAction.java index de44180a83e8e..eff6c6a5b387b 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStartTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStartTransformAction.java @@ -23,7 +23,7 @@ public class RestStartTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_start", POST)); + return singletonList(new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_start")); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStopTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStopTransformAction.java index edfbadd5f8697..9cbc259e8be20 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStopTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestStopTransformAction.java @@ -22,7 +22,7 @@ public class RestStopTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_stop", POST)); + return singletonList(new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_stop")); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java index cbfe87749eef5..e190e16db14a5 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/RestUpdateTransformAction.java @@ -24,7 +24,7 @@ public class RestUpdateTransformAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_update", POST)); + return singletonList(new Route(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID + "_update")); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestDeleteTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestDeleteTransformActionDeprecated.java index 0f60faa0a0799..ed4398f673c49 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestDeleteTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestDeleteTransformActionDeprecated.java @@ -35,8 +35,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, - DELETE, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(DELETE, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformActionDeprecated.java index 2a9ac6566d01b..eb9af9e0b8fc4 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformActionDeprecated.java @@ -39,10 +39,10 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { return unmodifiableList(asList( - new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED, GET, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger), - new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, GET, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger))); + new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED, + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger), + new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger))); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformStatsActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformStatsActionDeprecated.java index 68b795c5754e4..d6e5442d19ef5 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformStatsActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestGetTransformStatsActionDeprecated.java @@ -39,10 +39,10 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { return unmodifiableList(asList( - new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_stats", GET, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger), - new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stats", GET, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger))); + new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_stats", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger), + new DeprecatedRoute(GET, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stats", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger))); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java index c6691b59b58fa..a58b248f6777f 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPreviewTransformActionDeprecated.java @@ -37,8 +37,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_preview", - POST, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(POST, TransformField.REST_BASE_PATH_TRANSFORMS_DEPRECATED + "_preview", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java index 9159c284d109f..2d24c06e17106 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestPutTransformActionDeprecated.java @@ -37,8 +37,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, PUT, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(PUT, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED, + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStartTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStartTransformActionDeprecated.java index c665c4ca991e4..9e5bbef2dc151 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStartTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStartTransformActionDeprecated.java @@ -36,8 +36,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_start", - POST, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_start", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStopTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStopTransformActionDeprecated.java index 3335a41d00298..ad9b6d8509449 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStopTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestStopTransformActionDeprecated.java @@ -35,8 +35,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stop", POST, - TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_stop", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java index 63a68f71a8ac5..7c30217bddf03 100644 --- a/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java +++ b/x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/rest/action/compat/RestUpdateTransformActionDeprecated.java @@ -37,8 +37,8 @@ public List handledRoutes() { @Override public List deprecatedRoutes() { - return singletonList(new DeprecatedRoute(TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_update", - POST, TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); + return singletonList(new DeprecatedRoute(POST, TransformField.REST_BASE_PATH_TRANSFORMS_BY_ID_DEPRECATED + "_update", + TransformMessages.REST_DEPRECATED_ENDPOINT, deprecationLogger)); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java index 04dba0903a860..fd294f1389077 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestAckWatchAction.java @@ -35,10 +35,10 @@ public class RestAckWatchAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/watch/{id}/_ack", POST), - new Route("/_watcher/watch/{id}/_ack", PUT), - new Route("/_watcher/watch/{id}/_ack/{actions}", POST), - new Route("/_watcher/watch/{id}/_ack/{actions}", PUT))); + new Route(POST, "/_watcher/watch/{id}/_ack"), + new Route(PUT, "/_watcher/watch/{id}/_ack"), + new Route(POST, "/_watcher/watch/{id}/_ack/{actions}"), + new Route(PUT, "/_watcher/watch/{id}/_ack/{actions}"))); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java index 066f82e24f4a4..161a3b519c183 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestActivateWatchAction.java @@ -35,8 +35,8 @@ public class RestActivateWatchAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/watch/{id}/_activate", POST), - new Route("/_watcher/watch/{id}/_activate", PUT))); + new Route(POST, "/_watcher/watch/{id}/_activate"), + new Route(PUT, "/_watcher/watch/{id}/_activate"))); } @Override @@ -64,8 +64,8 @@ public static class DeactivateRestHandler extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/watch/{id}/_deactivate", POST), - new Route("/_watcher/watch/{id}/_deactivate", PUT))); + new Route(POST, "/_watcher/watch/{id}/_deactivate"), + new Route(PUT, "/_watcher/watch/{id}/_deactivate"))); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java index 47c2e9c01641c..171bad825cb84 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestDeleteWatchAction.java @@ -29,7 +29,7 @@ public class RestDeleteWatchAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_watcher/watch/{id}", DELETE)); + return singletonList(new Route(DELETE, "/_watcher/watch/{id}")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java index df1bcf54d4431..ab56f87bc6100 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestExecuteWatchAction.java @@ -51,10 +51,10 @@ public class RestExecuteWatchAction extends BaseRestHandler implements RestReque @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/watch/{id}/_execute", POST), - new Route("/_watcher/watch/{id}/_execute", PUT), - new Route("/_watcher/watch/_execute", POST), - new Route("/_watcher/watch/_execute", PUT))); + new Route(POST, "/_watcher/watch/{id}/_execute"), + new Route(PUT, "/_watcher/watch/{id}/_execute"), + new Route(POST, "/_watcher/watch/_execute"), + new Route(PUT, "/_watcher/watch/_execute"))); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java index e4a287431b663..65fc95285c129 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestGetWatchAction.java @@ -29,7 +29,7 @@ public class RestGetWatchAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_watcher/watch/{id}", GET)); + return singletonList(new Route(GET, "/_watcher/watch/{id}")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java index 068cf945a9253..39b599d513f69 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestPutWatchAction.java @@ -37,8 +37,8 @@ public class RestPutWatchAction extends BaseRestHandler implements RestRequestFi @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/watch/{id}", POST), - new Route("/_watcher/watch/{id}", PUT))); + new Route(POST, "/_watcher/watch/{id}"), + new Route(PUT, "/_watcher/watch/{id}"))); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java index c061feced4afe..c50ad989eab54 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatchServiceAction.java @@ -22,7 +22,7 @@ public class RestWatchServiceAction extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_watcher/_start", POST)); + return singletonList(new Route(POST, "/_watcher/_start")); } @Override @@ -40,7 +40,7 @@ public static class StopRestHandler extends BaseRestHandler { @Override public List handledRoutes() { - return singletonList(new Route("/_watcher/_stop", POST)); + return singletonList(new Route(POST, "/_watcher/_stop")); } @Override diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java index 641f4b36e371c..ba55822108c02 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/rest/action/RestWatcherStatsAction.java @@ -32,8 +32,8 @@ public class RestWatcherStatsAction extends BaseRestHandler { @Override public List handledRoutes() { return unmodifiableList(asList( - new Route("/_watcher/stats", GET), - new Route("/_watcher/stats/{metric}", GET))); + new Route(GET, "/_watcher/stats"), + new Route(GET, "/_watcher/stats/{metric}"))); } @Override