use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.
the class RestIndexTemplate method existsTemplate.
@Override
public boolean existsTemplate(ExistsTemplateRequest existsTemplateRequest) {
Assert.notNull(existsTemplateRequest, "existsTemplateRequest must not be null");
IndexTemplatesExistRequest putIndexTemplateRequest = requestFactory.indexTemplatesExistsRequest(existsTemplateRequest);
return restTemplate.execute(client -> client.indices().existsTemplate(putIndexTemplateRequest, RequestOptions.DEFAULT));
}
use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project kms by mahonelau.
the class KmEsMgntServiceImpl method checkTemplateExists.
private boolean checkTemplateExists(String templateName) throws IOException {
IndexTemplatesExistRequest request = new IndexTemplatesExistRequest(templateName);
boolean response = restHighLevelClient.indices().existsTemplate(request, RequestOptions.DEFAULT);
return response;
}
use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.
the class ReactiveIndexTemplate method existsTemplate.
@Override
public Mono<Boolean> existsTemplate(ExistsTemplateRequest existsTemplateRequest) {
Assert.notNull(existsTemplateRequest, "existsTemplateRequest must not be null");
IndexTemplatesExistRequest indexTemplatesExistRequest = requestFactory.indexTemplatesExistsRequest(existsTemplateRequest);
return Mono.from(operations.executeWithIndicesClient(client -> client.existsTemplate(indexTemplatesExistRequest)));
}
use of org.elasticsearch.client.indices.IndexTemplatesExistRequest in project spring-data-elasticsearch by spring-projects.
the class RequestConverters method templatesExist.
public static Request templatesExist(IndexTemplatesExistRequest indexTemplatesExistRequest) {
final String endpoint = new RequestConverters.EndpointBuilder().addPathPartAsIs("_template").addCommaSeparatedPathParts(indexTemplatesExistRequest.names()).build();
final Request request = new Request(HttpHead.METHOD_NAME, endpoint);
final RequestConverters.Params params = new RequestConverters.Params(request);
params.withLocal(indexTemplatesExistRequest.isLocal());
params.withMasterTimeout(indexTemplatesExistRequest.getMasterNodeTimeout());
return request;
}
Aggregations