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 235209243ee58..d08918b562667 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 @@ -17,11 +17,14 @@ import java.io.IOException; import java.util.List; +import java.util.Set; import static org.elasticsearch.rest.RestRequest.Method.GET; public class RestDeprecationInfoAction extends BaseRestHandler { + private static final Set SUPPORTED_CAPABILITIES = Set.of("data_streams", "ilm_policies", "templates"); + @Override public List routes() { return List.of( @@ -53,4 +56,9 @@ private static RestChannelConsumer handleGet(final RestRequest request, NodeClie ); return channel -> client.execute(DeprecationInfoAction.INSTANCE, infoRequest, new RestToXContentListener<>(channel)); } + + @Override + public Set supportedCapabilities() { + return SUPPORTED_CAPABILITIES; + } } diff --git a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/deprecation/10_basic.yml b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/deprecation/10_basic.yml index 78015468ba673..92a48e737d453 100644 --- a/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/deprecation/10_basic.yml +++ b/x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/deprecation/10_basic.yml @@ -11,9 +11,11 @@ setup: - method: GET path: /_migration/deprecations capabilities: [ data_streams, ilm_policies, templates ] - test_runner_features: capabilities + test_runner_features: [capabilities, allowed_warnings] reason: "Support for data streams, ILM policies and templates" - do: + allowed_warnings: + - "this request accesses system indices: [.security-7], but in a future major version, direct access to system indices will be prevented by default" migration.deprecations: index: "*" - length: { cluster_settings: 0 }