Search in sources :

Example 1 with IndexTemplateMetadata

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

the class ClientES7 method existingTemplates.

private String[] existingTemplates() {
    final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest();
    final GetIndexTemplatesResponse result = client.execute((c, requestOptions) -> c.indices().getIndexTemplate(getIndexTemplatesRequest, requestOptions));
    return result.getIndexTemplates().stream().map(IndexTemplateMetadata::name).toArray(String[]::new);
}
Also used : GetIndexTemplatesResponse(org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.GetIndexTemplatesResponse) GetIndexTemplatesRequest(org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.GetIndexTemplatesRequest)

Aggregations

GetIndexTemplatesRequest (org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.GetIndexTemplatesRequest)1 GetIndexTemplatesResponse (org.graylog.shaded.elasticsearch7.org.elasticsearch.client.indices.GetIndexTemplatesResponse)1