|
27 | 27 | import java.util.List;
|
28 | 28 | import java.util.Map;
|
29 | 29 |
|
30 |
| -import static org.elasticsearch.core.RestApiVersion.V_8; |
31 | 30 | import static org.elasticsearch.rest.RestRequest.Method.GET;
|
32 | 31 | import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
|
33 | 32 | import static org.elasticsearch.rest.RestStatus.OK;
|
@@ -62,17 +61,17 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC
|
62 | 61 | overrideParams.put(License.REST_VIEW_MODE, "true");
|
63 | 62 | overrideParams.put(License.LICENSE_VERSION_MODE, String.valueOf(License.VERSION_CURRENT));
|
64 | 63 |
|
65 |
| - // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true |
66 |
| - if (request.getRestApiVersion() == V_8 && request.hasParam("accept_enterprise")) { |
| 64 | + // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0+ the flag is deprecated and can only be true |
| 65 | + if (request.hasParam("accept_enterprise")) { |
67 | 66 | deprecationLogger.warn(
|
68 |
| - DeprecationCategory.COMPATIBLE_API, |
| 67 | + DeprecationCategory.API, |
69 | 68 | "get_license_accept_enterprise",
|
70 | 69 | "Including [accept_enterprise] in get license requests is deprecated."
|
71 | 70 | + " The parameter will be removed in the next major version"
|
72 | 71 | );
|
73 |
| - if (request.paramAsBoolean("accept_enterprise", true) == false) { // consumes the parameter to avoid error |
74 |
| - throw new IllegalArgumentException("The [accept_enterprise] parameters may not be false"); |
75 |
| - } |
| 72 | + } |
| 73 | + if (request.paramAsBoolean("accept_enterprise", true) == false) { // consumes the parameter to avoid error |
| 74 | + throw new IllegalArgumentException("The [accept_enterprise] parameters may not be false"); |
76 | 75 | }
|
77 | 76 |
|
78 | 77 | final ToXContent.Params params = new ToXContent.DelegatingMapParams(overrideParams, request);
|
|
0 commit comments