Skip to content

Commit fcf634c

Browse files
authored
V_7 deprecation logging set to critical (#118298)
This PR changes all API deprecation logging for V_7 to be at the “critical” level.
1 parent d553989 commit fcf634c

File tree

29 files changed

+233
-78
lines changed

29 files changed

+233
-78
lines changed

docs/changelog/118298.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
pr: 118298
2+
summary: Enhancement/v7 critical deprecation logging
3+
area: Infra/REST API
4+
type: deprecation
5+
issues: []
6+
deprecation:
7+
title: V_7 deprecation logging set to critical
8+
area: REST API
9+
details: This changes the V_7 API deprecation logging level to CRITICAL.
10+
impact: Any usage of deprecated V_7 API features will now be logged at the CRITICAL level. This does not change functionality.

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.script.mustache;
1111

1212
import org.elasticsearch.client.internal.node.NodeClient;
13+
import org.elasticsearch.common.logging.DeprecationLogger;
1314
import org.elasticsearch.common.settings.Settings;
1415
import org.elasticsearch.core.RestApiVersion;
1516
import org.elasticsearch.rest.BaseRestHandler;
@@ -47,8 +48,12 @@ public List<Route> routes() {
4748
new Route(POST, "/_msearch/template"),
4849
new Route(GET, "/{index}/_msearch/template"),
4950
new Route(POST, "/{index}/_msearch/template"),
50-
Route.builder(GET, "/{index}/{type}/_msearch/template").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
51-
Route.builder(POST, "/{index}/{type}/_msearch/template").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
51+
Route.builder(GET, "/{index}/{type}/_msearch/template")
52+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
53+
.build(),
54+
Route.builder(POST, "/{index}/{type}/_msearch/template")
55+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
56+
.build()
5257
);
5358
}
5459

modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import org.elasticsearch.action.search.SearchRequest;
1313
import org.elasticsearch.client.internal.node.NodeClient;
14+
import org.elasticsearch.common.logging.DeprecationLogger;
1415
import org.elasticsearch.core.RestApiVersion;
1516
import org.elasticsearch.features.NodeFeature;
1617
import org.elasticsearch.rest.BaseRestHandler;
@@ -50,10 +51,10 @@ public List<Route> routes() {
5051
new Route(GET, "/{index}/_search/template"),
5152
new Route(POST, "/{index}/_search/template"),
5253
Route.builder(GET, "/{index}/{type}/_search/template")
53-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
54+
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
5455
.build(),
5556
Route.builder(POST, "/{index}/{type}/_search/template")
56-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
57+
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
5758
.build()
5859
);
5960
}

modules/reindex/src/main/java/org/elasticsearch/reindex/RestDeleteByQueryAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.reindex;
1111

1212
import org.elasticsearch.client.internal.node.NodeClient;
13+
import org.elasticsearch.common.logging.DeprecationLogger;
1314
import org.elasticsearch.core.RestApiVersion;
1415
import org.elasticsearch.features.NodeFeature;
1516
import org.elasticsearch.index.reindex.DeleteByQueryAction;
@@ -43,7 +44,7 @@ public List<Route> routes() {
4344
return List.of(
4445
new Route(POST, "/{index}/_delete_by_query"),
4546
Route.builder(POST, "/{index}/{type}/_delete_by_query")
46-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
47+
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
4748
.build()
4849
);
4950

modules/reindex/src/main/java/org/elasticsearch/reindex/RestUpdateByQueryAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
package org.elasticsearch.reindex;
1111

1212
import org.elasticsearch.client.internal.node.NodeClient;
13+
import org.elasticsearch.common.logging.DeprecationLogger;
1314
import org.elasticsearch.core.RestApiVersion;
1415
import org.elasticsearch.features.NodeFeature;
1516
import org.elasticsearch.index.reindex.UpdateByQueryAction;
@@ -44,7 +45,7 @@ public List<Route> routes() {
4445
return List.of(
4546
new Route(POST, "/{index}/_update_by_query"),
4647
Route.builder(POST, "/{index}/{type}/_update_by_query")
47-
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7)
48+
.deprecated(RestSearchAction.TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
4849
.build()
4950
);
5051
}

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestAddVotingConfigExclusionAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.elasticsearch.action.admin.cluster.configuration.TransportAddVotingConfigExclusionsAction;
1414
import org.elasticsearch.client.internal.node.NodeClient;
1515
import org.elasticsearch.common.Strings;
16+
import org.elasticsearch.common.logging.DeprecationLogger;
1617
import org.elasticsearch.core.RestApiVersion;
1718
import org.elasticsearch.core.TimeValue;
1819
import org.elasticsearch.rest.BaseRestHandler;
@@ -42,7 +43,7 @@ public List<Route> routes() {
4243
return List.of(
4344
new Route(POST, "/_cluster/voting_config_exclusions"),
4445
Route.builder(POST, "/_cluster/voting_config_exclusions/{node_name}")
45-
.deprecated(DEPRECATION_MESSAGE, RestApiVersion.V_7)
46+
.deprecated(DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
4647
.build()
4748
);
4849
}

server/src/main/java/org/elasticsearch/rest/action/admin/cluster/RestNodesHotThreadsAction.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import org.elasticsearch.action.admin.cluster.node.hotthreads.TransportNodesHotThreadsAction;
1515
import org.elasticsearch.client.internal.node.NodeClient;
1616
import org.elasticsearch.common.Strings;
17+
import org.elasticsearch.common.logging.DeprecationLogger;
1718
import org.elasticsearch.core.RestApiVersion;
1819
import org.elasticsearch.monitor.jvm.HotThreads;
1920
import org.elasticsearch.rest.BaseRestHandler;
@@ -78,20 +79,22 @@ public List<Route> routes() {
7879
new Route(GET, "/_nodes/{nodeId}/hot_threads"),
7980

8081
Route.builder(GET, "/_cluster/nodes/hot_threads")
81-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS, RestApiVersion.V_7)
82+
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOT_THREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
8283
.build(),
8384
Route.builder(GET, "/_cluster/nodes/{nodeId}/hot_threads")
84-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS, RestApiVersion.V_7)
85+
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOT_THREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
8586
.build(),
8687
Route.builder(GET, "/_cluster/nodes/hotthreads")
87-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS, RestApiVersion.V_7)
88+
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_HOTTHREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
8889
.build(),
8990
Route.builder(GET, "/_cluster/nodes/{nodeId}/hotthreads")
90-
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS, RestApiVersion.V_7)
91+
.deprecated(DEPRECATED_MESSAGE_CLUSTER_NODES_NODEID_HOTTHREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
92+
.build(),
93+
Route.builder(GET, "/_nodes/hotthreads")
94+
.deprecated(DEPRECATED_MESSAGE_NODES_HOTTHREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
9195
.build(),
92-
Route.builder(GET, "/_nodes/hotthreads").deprecated(DEPRECATED_MESSAGE_NODES_HOTTHREADS, RestApiVersion.V_7).build(),
9396
Route.builder(GET, "/_nodes/{nodeId}/hotthreads")
94-
.deprecated(DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS, RestApiVersion.V_7)
97+
.deprecated(DEPRECATED_MESSAGE_NODES_NODEID_HOTTHREADS, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
9598
.build()
9699
);
97100
}

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetFieldMappingAction.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,15 @@ public List<Route> routes() {
4848
return List.of(
4949
new Route(GET, "/_mapping/field/{fields}"),
5050
new Route(GET, "/{index}/_mapping/field/{fields}"),
51-
Route.builder(GET, "/_mapping/{type}/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
52-
Route.builder(GET, "/{index}/{type}/_mapping/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(GET, "/{index}/_mapping/{type}/field/{fields}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
51+
Route.builder(GET, "/_mapping/{type}/field/{fields}")
52+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
53+
.build(),
54+
Route.builder(GET, "/{index}/{type}/_mapping/field/{fields}")
55+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
56+
.build(),
57+
Route.builder(GET, "/{index}/_mapping/{type}/field/{fields}")
58+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
59+
.build()
5460
);
5561
}
5662

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetMappingAction.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,23 @@ public List<Route> routes() {
4646
return List.of(
4747
new Route(GET, "/_mapping"),
4848
new Route(GET, "/_mappings"),
49-
Route.builder(GET, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
49+
Route.builder(GET, "/{index}/{type}/_mapping")
50+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
51+
.build(),
5052
new Route(GET, "/{index}/_mapping"),
5153
new Route(GET, "/{index}/_mappings"),
52-
Route.builder(GET, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(GET, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
54-
Route.builder(HEAD, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
55-
Route.builder(GET, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
54+
Route.builder(GET, "/{index}/_mappings/{type}")
55+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
56+
.build(),
57+
Route.builder(GET, "/{index}/_mapping/{type}")
58+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
59+
.build(),
60+
Route.builder(HEAD, "/{index}/_mapping/{type}")
61+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
62+
.build(),
63+
Route.builder(GET, "/_mapping/{type}")
64+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
65+
.build()
5666
);
5767
}
5868

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestPutMappingAction.java

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,42 @@ public List<Route> routes() {
4646
new Route(PUT, "/{index}/_mapping/"),
4747
new Route(POST, "/{index}/_mappings/"),
4848
new Route(PUT, "/{index}/_mappings/"),
49-
Route.builder(POST, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
50-
Route.builder(PUT, "/{index}/{type}/_mapping").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
51-
Route.builder(POST, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
52-
Route.builder(PUT, "/{index}/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
53-
Route.builder(POST, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
54-
Route.builder(PUT, "/_mapping/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
55-
Route.builder(POST, "/{index}/{type}/_mappings").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
56-
Route.builder(PUT, "/{index}/{type}/_mappings").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
57-
Route.builder(POST, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
58-
Route.builder(PUT, "/{index}/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
59-
Route.builder(POST, "/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build(),
60-
Route.builder(PUT, "/_mappings/{type}").deprecated(TYPES_DEPRECATION_MESSAGE, RestApiVersion.V_7).build()
49+
Route.builder(POST, "/{index}/{type}/_mapping")
50+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
51+
.build(),
52+
Route.builder(PUT, "/{index}/{type}/_mapping")
53+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
54+
.build(),
55+
Route.builder(POST, "/{index}/_mapping/{type}")
56+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
57+
.build(),
58+
Route.builder(PUT, "/{index}/_mapping/{type}")
59+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
60+
.build(),
61+
Route.builder(POST, "/_mapping/{type}")
62+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
63+
.build(),
64+
Route.builder(PUT, "/_mapping/{type}")
65+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
66+
.build(),
67+
Route.builder(POST, "/{index}/{type}/_mappings")
68+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
69+
.build(),
70+
Route.builder(PUT, "/{index}/{type}/_mappings")
71+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
72+
.build(),
73+
Route.builder(POST, "/{index}/_mappings/{type}")
74+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
75+
.build(),
76+
Route.builder(PUT, "/{index}/_mappings/{type}")
77+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
78+
.build(),
79+
Route.builder(POST, "/_mappings/{type}")
80+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
81+
.build(),
82+
Route.builder(PUT, "/_mappings/{type}")
83+
.deprecated(TYPES_DEPRECATION_MESSAGE, DeprecationLogger.CRITICAL, RestApiVersion.V_7)
84+
.build()
6185
);
6286
}
6387

0 commit comments

Comments
 (0)