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:
parent
f988611691
commit
9764730d49
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package org.elasticsearch.datastreams.options.action;
|
||||
|
||||
import org.elasticsearch.TransportVersions;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.action.ActionType;
|
||||
|
@ -59,7 +60,6 @@ public class GetDataStreamOptionsAction {
|
|||
IndicesOptions.GatekeeperOptions.builder().allowAliasToMultipleIndices(false).allowClosedIndices(true).allowSelectors(false)
|
||||
)
|
||||
.build();
|
||||
private boolean includeDefaults = false;
|
||||
|
||||
public Request(TimeValue masterNodeTimeout, String[] names) {
|
||||
super(masterNodeTimeout);
|
||||
|
@ -69,7 +69,6 @@ public class GetDataStreamOptionsAction {
|
|||
public Request(TimeValue masterNodeTimeout, String[] names, boolean includeDefaults) {
|
||||
super(masterNodeTimeout);
|
||||
this.names = names;
|
||||
this.includeDefaults = includeDefaults;
|
||||
}
|
||||
|
||||
public String[] getNames() {
|
||||
|
@ -95,7 +94,10 @@ public class GetDataStreamOptionsAction {
|
|||
super(in);
|
||||
this.names = in.readOptionalStringArray();
|
||||
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
|
||||
|
@ -103,14 +105,12 @@ public class GetDataStreamOptionsAction {
|
|||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
Request request = (Request) o;
|
||||
return Arrays.equals(names, request.names)
|
||||
&& indicesOptions.equals(request.indicesOptions)
|
||||
&& includeDefaults == request.includeDefaults;
|
||||
return Arrays.equals(names, request.names) && indicesOptions.equals(request.indicesOptions);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = Objects.hash(indicesOptions, includeDefaults);
|
||||
int result = Objects.hash(indicesOptions);
|
||||
result = 31 * result + Arrays.hashCode(names);
|
||||
return result;
|
||||
}
|
||||
|
@ -125,10 +125,6 @@ public class GetDataStreamOptionsAction {
|
|||
return indicesOptions;
|
||||
}
|
||||
|
||||
public boolean includeDefaults() {
|
||||
return includeDefaults;
|
||||
}
|
||||
|
||||
public Request indicesOptions(IndicesOptions indicesOptions) {
|
||||
this.indicesOptions = indicesOptions;
|
||||
return this;
|
||||
|
@ -144,11 +140,6 @@ public class GetDataStreamOptionsAction {
|
|||
this.names = indices;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Request includeDefaults(boolean includeDefaults) {
|
||||
this.includeDefaults = includeDefaults;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Response extends ActionResponse implements ChunkedToXContentObject {
|
||||
|
|
|
@ -47,7 +47,6 @@ public class RestGetDataStreamOptionsAction extends BaseRestHandler {
|
|||
RestUtils.getMasterNodeTimeout(request),
|
||||
Strings.splitStringByCommaToArray(request.param("name"))
|
||||
);
|
||||
getDataStreamOptionsRequest.includeDefaults(request.paramAsBoolean("include_defaults", false));
|
||||
getDataStreamOptionsRequest.indicesOptions(IndicesOptions.fromRequest(request, getDataStreamOptionsRequest.indicesOptions()));
|
||||
return channel -> new RestCancellableNodeClient(client, request.getHttpChannel()).execute(
|
||||
GetDataStreamOptionsAction.INSTANCE,
|
||||
|
|
|
@ -38,10 +38,6 @@
|
|||
"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":{
|
||||
"type":"time",
|
||||
"description":"Specify timeout for connection to master"
|
||||
|
|
|
@ -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 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 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 INITIAL_ELASTICSEARCH_9_0_1 = def(9_000_0_10);
|
||||
public static final TransportVersion INITIAL_ELASTICSEARCH_9_0_2 = def(9_000_0_11);
|
||||
|
|
Loading…
Reference in New Issue