diff --git a/src/main/java/org/opensearch/security/dlic/rest/api/FlushCacheApiAction.java b/src/main/java/org/opensearch/security/dlic/rest/api/FlushCacheApiAction.java index 2f579ecbd9..96314b189a 100644 --- a/src/main/java/org/opensearch/security/dlic/rest/api/FlushCacheApiAction.java +++ b/src/main/java/org/opensearch/security/dlic/rest/api/FlushCacheApiAction.java @@ -39,9 +39,21 @@ public class FlushCacheApiAction extends AbstractApiAction { private static final List routes = addRoutesPrefix( ImmutableList.of( new Route(Method.DELETE, "/cache"), - new Route(Method.GET, "/cache"), - new Route(Method.PUT, "/cache"), - new Route(Method.POST, "/cache") + new DeprecatedRoute( + Method.GET, + "/cache", + "GET is not supported for /cache endpoint and will be removed in the next major version. Use DELETE instead." + ), + new DeprecatedRoute( + Method.PUT, + "/cache", + "PUT is not supported for /cache endpoint and will be removed in the next major version. Use DELETE instead." + ), + new DeprecatedRoute( + Method.POST, + "/cache", + "POST is not supported for /cache endpoint and will be removed in the next major version. Use DELETE instead." + ) ) );