Search in sources :

Example 1 with PutIndexTemplateRequest

use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.PutIndexTemplateRequest in project graylog2-server by Graylog2.

the class ClientES7 method putTemplate.

@Override
public void putTemplate(String templateName, Map<String, Object> source) {
    final PutIndexTemplateRequest request = new PutIndexTemplateRequest(templateName).source(source);
    client.execute((c, requestOptions) -> c.indices().putTemplate(request, requestOptions), "Unable to put template " + templateName);
}
Also used : PutIndexTemplateRequest(org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.PutIndexTemplateRequest)

Example 2 with PutIndexTemplateRequest

use of org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.PutIndexTemplateRequest in project graylog2-server by Graylog2.

the class IndicesAdapterES7 method ensureIndexTemplate.

@Override
public boolean ensureIndexTemplate(String templateName, Map<String, Object> template) {
    final PutIndexTemplateRequest request = new PutIndexTemplateRequest(templateName).source(template);
    final AcknowledgedResponse result = client.execute((c, requestOptions) -> c.indices().putTemplate(request, requestOptions), "Unable to create index template " + templateName);
    return result.isAcknowledged();
}
Also used : AcknowledgedResponse(org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse) PutIndexTemplateRequest(org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.PutIndexTemplateRequest)

Aggregations

PutIndexTemplateRequest (org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.PutIndexTemplateRequest)2 AcknowledgedResponse (org.graylog.shaded.elasticsearch7.org.elasticsearch.action.support.master.AcknowledgedResponse)1