|
@@ -11,6 +11,7 @@ package org.elasticsearch.action.admin.indices.alias;
|
|
|
import org.elasticsearch.ElasticsearchGenerationException;
|
|
import org.elasticsearch.ElasticsearchGenerationException;
|
|
|
import org.elasticsearch.action.ActionRequestValidationException;
|
|
import org.elasticsearch.action.ActionRequestValidationException;
|
|
|
import org.elasticsearch.action.AliasesRequest;
|
|
import org.elasticsearch.action.AliasesRequest;
|
|
|
|
|
+import org.elasticsearch.action.IndicesRequest;
|
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
|
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
|
import org.elasticsearch.action.support.master.AcknowledgedRequest;
|
|
|
import org.elasticsearch.cluster.metadata.AliasAction;
|
|
import org.elasticsearch.cluster.metadata.AliasAction;
|
|
@@ -48,7 +49,7 @@ import static org.elasticsearch.common.xcontent.ObjectParser.fromList;
|
|
|
/**
|
|
/**
|
|
|
* A request to add/remove aliases for one or more indices.
|
|
* A request to add/remove aliases for one or more indices.
|
|
|
*/
|
|
*/
|
|
|
-public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesRequest> implements ToXContentObject {
|
|
|
|
|
|
|
+public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesRequest> implements IndicesRequest, ToXContentObject {
|
|
|
|
|
|
|
|
private List<AliasActions> allAliasActions = new ArrayList<>();
|
|
private List<AliasActions> allAliasActions = new ArrayList<>();
|
|
|
private String origin = "";
|
|
private String origin = "";
|
|
@@ -482,6 +483,11 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
return indices;
|
|
return indices;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean includeDataStreams() {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public IndicesOptions indicesOptions() {
|
|
public IndicesOptions indicesOptions() {
|
|
|
return INDICES_OPTIONS;
|
|
return INDICES_OPTIONS;
|
|
@@ -615,6 +621,18 @@ public class IndicesAliasesRequest extends AcknowledgedRequest<IndicesAliasesReq
|
|
|
return INDICES_OPTIONS;
|
|
return INDICES_OPTIONS;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String[] indices() {
|
|
|
|
|
+ return allAliasActions.stream()
|
|
|
|
|
+ .flatMap(aliasActions -> Arrays.stream(aliasActions.indices()))
|
|
|
|
|
+ .toArray(String[]::new);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean includeDataStreams() {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
|
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
|
|
|
builder.startObject();
|
|
builder.startObject();
|