use of org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusResponse in project elasticsearch by elastic.
the class OldIndexUtils method getUpgradeStatus.
@SuppressWarnings("unchecked")
public static Collection<IndexUpgradeStatus> getUpgradeStatus(Client client, String... indices) throws Exception {
UpgradeStatusResponse upgradeStatusResponse = client.admin().indices().prepareUpgradeStatus(indices).get();
assertNoFailures(upgradeStatusResponse);
return upgradeStatusResponse.getIndices().values();
}
use of org.elasticsearch.action.admin.indices.upgrade.get.UpgradeStatusResponse in project elasticsearch by elastic.
the class RestUpgradeAction method handleGet.
private RestChannelConsumer handleGet(final RestRequest request, NodeClient client) {
UpgradeStatusRequest statusRequest = new UpgradeStatusRequest(Strings.splitStringByCommaToArray(request.param("index")));
statusRequest.indicesOptions(IndicesOptions.fromRequest(request, statusRequest.indicesOptions()));
return channel -> client.admin().indices().upgradeStatus(statusRequest, new RestBuilderListener<UpgradeStatusResponse>(channel) {
@Override
public RestResponse buildResponse(UpgradeStatusResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
response.toXContent(builder, request);
builder.endObject();
return new BytesRestResponse(OK, builder);
}
});
}
Aggregations