Remove include_default query param from get data stream options. (#128730)

Initially we added to the `include_defaults` to the get data stream
options REST API as it was used in the lifecycler API; however, we
decided to simplify it and not use it. We remove it now before it gets
adopted.
This commit is contained in:
Mary Gouseti 2025-06-03 11:15:42 +03:00 committed by GitHub
parent f988611691
commit 9764730d49
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 21 deletions

View File

@ -8,6 +8,7 @@
*/ */
package org.elasticsearch.datastreams.options.action; package org.elasticsearch.datastreams.options.action;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
@ -59,7 +60,6 @@ public class GetDataStreamOptionsAction {
IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false) IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false)
) )
.build(); .build();
private boolean includeDefaults = false;
public Request(TimeValue masterNodeTimeout, String[] names) { public Request(TimeValue masterNodeTimeout, String[] names) {
super(masterNodeTimeout); super(masterNodeTimeout);
@ -69,7 +69,6 @@ public class GetDataStreamOptionsAction {
public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) { public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) {
super(masterNodeTimeout); super(masterNodeTimeout);
this.names = names; this.names = names;
this.includeDefaults = includeDefaults;
} }
public String[] getNames() { public String[] getNames() {
@ -95,7 +94,10 @@ public class GetDataStreamOptionsAction {
super(in); super(in);
this.names = in.readOptionalStringArray(); this.names = in.readOptionalStringArray();
this.indicesOptions = IndicesOptions.readIndicesOptions(in); this.indicesOptions = IndicesOptions.readIndicesOptions(in);
this.includeDefaults = in.readBoolean(); // This boolean was removed in 8.19
if (in.getTransportVersion().isPatchFrom(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19) == false) {
in.readBoolean();
}
} }
@Override @Override
@ -103,14 +105,12 @@ public class GetDataStreamOptionsAction {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
Request request = (Request) o; Request request = (Request) o;
return Arrays.equals(names, request.names) return Arrays.equals(names, request.names) && indicesOptions.equals(request.indicesOptions);
&& indicesOptions.equals(request.indicesOptions)
&& includeDefaults == request.includeDefaults;
} }
@Override @Override
public int hashCode() { public int hashCode() {
int result = Objects.hash(indicesOptions, includeDefaults); int result = Objects.hash(indicesOptions);
result = 31 * result + Arrays.hashCode(names); result = 31 * result + Arrays.hashCode(names);
return result; return result;
} }
@ -125,10 +125,6 @@ public class GetDataStreamOptionsAction {
return indicesOptions; return indicesOptions;
} }
public boolean includeDefaults() {
return includeDefaults;
}
public Request indicesOptions(IndicesOptions indicesOptions) { public Request indicesOptions(IndicesOptions indicesOptions) {
this.indicesOptions = indicesOptions; this.indicesOptions = indicesOptions;
return this; return this;
@ -144,11 +140,6 @@ public class GetDataStreamOptionsAction {
this.names = indices; this.names = indices;
return this; return this;
} }
public Request includeDefaults(boolean includeDefaults) {
this.includeDefaults = includeDefaults;
return this;
}
} }
public static class Response extends ActionResponse implements ChunkedToXContentObject { public static class Response extends ActionResponse implements ChunkedToXContentObject {

View File

@ -47,7 +47,6 @@ public class RestGetDataStreamOptionsAction extends BaseRestHandler {
RestUtils.getMasterNodeTimeout(request), RestUtils.getMasterNodeTimeout(request),
Strings.splitStringByCommaToArray(request.param("name")) Strings.splitStringByCommaToArray(request.param("name"))
); );
getDataStreamOptionsRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
getDataStreamOptionsRequest.indicesOptions(IndicesOptions.fromRequest(request, getDataStreamOptionsRequest.indicesOptions())); getDataStreamOptionsRequest.indicesOptions(IndicesOptions.fromRequest(request, getDataStreamOptionsRequest.indicesOptions()));
return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).execute( return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).execute(
GetDataStreamOptionsAction.INSTANCE, GetDataStreamOptionsAction.INSTANCE,

View File

@ -38,10 +38,6 @@
"default":"open", "default":"open",
"description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)" "description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)"
}, },
"include_defaults":{
"type":"boolean",
"description":"Return all relevant default configurations for the data stream (default: false)"
},
"master_timeout":{ "master_timeout":{
"type":"time", "type":"time",
"description":"Specify timeout for connection to master" "description":"Specify timeout for connection to master"

View File

@ -185,6 +185,7 @@ public class TransportVersions {
public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED_8_19 = def(8_841_0_38); public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED_8_19 = def(8_841_0_38);
public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39); public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39);
public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ADDED_8_19 = def(8_841_0_40); public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ADDED_8_19 = def(8_841_0_40);
public static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 = def(8_841_0_41);
public static final TransportVersion V_9_0_0 = def(9_000_0_09); public static final TransportVersion V_9_0_0 = def(9_000_0_09);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10); public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11); public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);