mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-03 17:39:15 +00:00
update rest status
This commit is contained in:
parent
bce7f6c7ad
commit
1f29fa4fe9
@ -39,7 +39,6 @@ public class IngestModule extends AbstractModule {
|
|||||||
protected void configure() {
|
protected void configure() {
|
||||||
binder().bind(IngestRestFilter.class).asEagerSingleton();
|
binder().bind(IngestRestFilter.class).asEagerSingleton();
|
||||||
binder().bind(PipelineExecutionService.class).asEagerSingleton();
|
binder().bind(PipelineExecutionService.class).asEagerSingleton();
|
||||||
// TODO(talevy): write it! binder().bind(PipelineSimulateService.class).asEagerSingleton();
|
|
||||||
binder().bind(PipelineStore.class).asEagerSingleton();
|
binder().bind(PipelineStore.class).asEagerSingleton();
|
||||||
binder().bind(PipelineStoreClient.class).asEagerSingleton();
|
binder().bind(PipelineStoreClient.class).asEagerSingleton();
|
||||||
|
|
||||||
|
@ -23,10 +23,7 @@ import org.elasticsearch.action.ActionResponse;
|
|||||||
import org.elasticsearch.common.io.stream.StreamInput;
|
import org.elasticsearch.common.io.stream.StreamInput;
|
||||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||||
import org.elasticsearch.common.xcontent.StatusToXContent;
|
import org.elasticsearch.common.xcontent.StatusToXContent;
|
||||||
import org.elasticsearch.common.xcontent.ToXContent;
|
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||||
import org.elasticsearch.common.xcontent.XContentBuilderString;
|
|
||||||
import org.elasticsearch.ingest.Data;
|
|
||||||
import org.elasticsearch.rest.RestStatus;
|
import org.elasticsearch.rest.RestStatus;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -91,6 +88,11 @@ public class SimulatePipelineResponse extends ActionResponse implements StatusTo
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RestStatus status() {
|
public RestStatus status() {
|
||||||
|
for (SimulatedItemResponse response : responses) {
|
||||||
|
if (response.failed()) {
|
||||||
|
return response.status();
|
||||||
|
}
|
||||||
|
}
|
||||||
return RestStatus.OK;
|
return RestStatus.OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,7 +102,11 @@ public class SimulatedItemResponse implements Streamable, StatusToXContent {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RestStatus status() {
|
public RestStatus status() {
|
||||||
return null;
|
if (failed()) {
|
||||||
|
return RestStatus.BAD_REQUEST;
|
||||||
|
} else {
|
||||||
|
return RestStatus.OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user