Skip to content

Commit 9764730

Browse files
authored
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.
1 parent f988611 commit 9764730

File tree

4 files changed

+8
-21
lines changed

4 files changed

+8
-21
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/action/GetDataStreamOptionsAction.java

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99
package org.elasticsearch.datastreams.options.action;
1010

11+
import org.elasticsearch.TransportVersions;
1112
import org.elasticsearch.action.ActionRequestValidationException;
1213
import org.elasticsearch.action.ActionResponse;
1314
import org.elasticsearch.action.ActionType;
@@ -59,7 +60,6 @@ public static class Request extends LocalClusterStateRequest implements IndicesR
5960
IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false)
6061
)
6162
.build();
62-
private boolean includeDefaults = false;
6363

6464
public Request(TimeValue masterNodeTimeout, String[] names) {
6565
super(masterNodeTimeout);
@@ -69,7 +69,6 @@ public Request(TimeValue masterNodeTimeout, String[] names) {
6969
public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) {
7070
super(masterNodeTimeout);
7171
this.names = names;
72-
this.includeDefaults = includeDefaults;
7372
}
7473

7574
public String[] getNames() {
@@ -95,22 +94,23 @@ public Request(StreamInput in) throws IOException {
9594
super(in);
9695
this.names = in.readOptionalStringArray();
9796
this.indicesOptions = IndicesOptions.readIndicesOptions(in);
98-
this.includeDefaults = in.readBoolean();
97+
// This boolean was removed in 8.19
98+
if (in.getTransportVersion().isPatchFrom(TransportVersions.DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19) == false) {
99+
in.readBoolean();
100+
}
99101
}
100102

101103
@Override
102104
public boolean equals(Object o) {
103105
if (this == o) return true;
104106
if (o == null || getClass() != o.getClass()) return false;
105107
Request request = (Request) o;
106-
return Arrays.equals(names, request.names)
107-
&& indicesOptions.equals(request.indicesOptions)
108-
&& includeDefaults == request.includeDefaults;
108+
return Arrays.equals(names, request.names) && indicesOptions.equals(request.indicesOptions);
109109
}
110110

111111
@Override
112112
public int hashCode() {
113-
int result = Objects.hash(indicesOptions, includeDefaults);
113+
int result = Objects.hash(indicesOptions);
114114
result = 31 * result + Arrays.hashCode(names);
115115
return result;
116116
}
@@ -125,10 +125,6 @@ public IndicesOptions indicesOptions() {
125125
return indicesOptions;
126126
}
127127

128-
public boolean includeDefaults() {
129-
return includeDefaults;
130-
}
131-
132128
public Request indicesOptions(IndicesOptions indicesOptions) {
133129
this.indicesOptions = indicesOptions;
134130
return this;
@@ -144,11 +140,6 @@ public IndicesRequest indices(String... indices) {
144140
this.names = indices;
145141
return this;
146142
}
147-
148-
public Request includeDefaults(boolean includeDefaults) {
149-
this.includeDefaults = includeDefaults;
150-
return this;
151-
}
152143
}
153144

154145
public static class Response extends ActionResponse implements ChunkedToXContentObject {

modules/data-streams/src/main/java/org/elasticsearch/datastreams/options/rest/RestGetDataStreamOptionsAction.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
4747
RestUtils.getMasterNodeTimeout(request),
4848
Strings.splitStringByCommaToArray(request.param("name"))
4949
);
50-
getDataStreamOptionsRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
5150
getDataStreamOptionsRequest.indicesOptions(IndicesOptions.fromRequest(request, getDataStreamOptionsRequest.indicesOptions()));
5251
return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).execute(
5352
GetDataStreamOptionsAction.INSTANCE,

rest-api-spec/src/main/resources/rest-api-spec/api/indices.get_data_stream_options.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
"default":"open",
3939
"description":"Whether wildcard expressions should get expanded to open or closed indices (default: open)"
4040
},
41-
"include_defaults":{
42-
"type":"boolean",
43-
"description":"Return all relevant default configurations for the data stream (default: false)"
44-
},
4541
"master_timeout":{
4642
"type":"time",
4743
"description":"Specify timeout for connection to master"

server/src/main/java/org/elasticsearch/TransportVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ static TransportVersion def(int id) {
185185
public static final TransportVersion ML_INFERENCE_VERTEXAI_CHATCOMPLETION_ADDED_8_19 = def(8_841_0_38);
186186
public static final TransportVersion INFERENCE_CUSTOM_SERVICE_ADDED_8_19 = def(8_841_0_39);
187187
public static final TransportVersion IDP_CUSTOM_SAML_ATTRIBUTES_ADDED_8_19 = def(8_841_0_40);
188+
public static final TransportVersion DATA_STREAM_OPTIONS_API_REMOVE_INCLUDE_DEFAULTS_8_19 = def(8_841_0_41);
188189
public static final TransportVersion V_9_0_0 = def(9_000_0_09);
189190
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
190191
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);

0 commit comments

Comments
 (0)