use of org.webpieces.elasticsearch.actions.AtomicActionList in project webpieces by deanhiller.
the class ElasticClient method createAlias.
public XFuture<Response> createAlias(String alias, String indexName) {
Map<String, String> params = Collections.emptyMap();
AliasChange addAlias = new AliasChange();
addAlias.setIndex(indexName);
addAlias.setAlias(alias);
List<Action> actions = new ArrayList<Action>();
actions.add(new Action(addAlias, true));
AtomicActionList list = new AtomicActionList();
list.setActions(actions);
return performRequest("POST", "/_aliases", params, list);
}
use of org.webpieces.elasticsearch.actions.AtomicActionList in project webpieces by deanhiller.
the class ElasticClient method renameAlias.
public XFuture<Response> renameAlias(String previousIndex, String newIndex, String alias) {
Map<String, String> params = Collections.emptyMap();
AliasChange removeAlias = new AliasChange();
removeAlias.setIndex(previousIndex);
removeAlias.setAlias(alias);
AliasChange addAlias = new AliasChange();
addAlias.setIndex(newIndex);
addAlias.setAlias(alias);
List<Action> actions = new ArrayList<Action>();
actions.add(new Action(removeAlias, false));
actions.add(new Action(addAlias, true));
AtomicActionList list = new AtomicActionList();
list.setActions(actions);
return performRequest("POST", "/_aliases", params, list);
}
Aggregations