Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions rest-api-spec/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ tasks.named("yamlRestCompatTest").configure {
'indices.open/10_basic/?wait_for_active_shards=index-setting',
// not fixing this in #70966
'indices.put_template/11_basic_with_types/Put template with empty mappings',
'indices.shrink/30_copy_settings/Copy settings during shrink index',
'indices.split/30_copy_settings/Copy settings during split index',
'mlt/20_docs/Basic mlt query with docs',
'mlt/30_unlike/Basic mlt query with unlike',
'search.aggregation/200_top_hits_metric/top_hits aggregation with sequence numbers',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import org.elasticsearch.action.admin.indices.shrink.ResizeType;
import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.core.Booleans;
import org.elasticsearch.core.RestApiVersion;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.action.RestToXContentListener;
Expand All @@ -23,6 +26,7 @@
import static org.elasticsearch.rest.RestRequest.Method.PUT;

public abstract class RestResizeHandler extends BaseRestHandler {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestResizeHandler.class);

RestResizeHandler() {
}
Expand All @@ -34,6 +38,15 @@ public abstract class RestResizeHandler extends BaseRestHandler {

@Override
public final RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam("copy_settings")) {
deprecationLogger.compatibleApiWarning("copy_settings", "parameter [copy_settings] is deprecated and will be removed in 8.0.0");

final String rawCopySettings = request.param("copy_settings");
final boolean copySettings = Booleans.parseBoolean(rawCopySettings);
if (copySettings == false) {
throw new IllegalArgumentException("parameter [copy_settings] can not be explicitly set to [false]");
}
}
final ResizeRequest resizeRequest = new ResizeRequest(request.param("target"), request.param("index"));
resizeRequest.setResizeType(getResizeType());
request.applyContentParser(resizeRequest::fromXContent);
Expand Down