|
12 | 12 | import co.elastic.clients.elasticsearch.ilm.Phases;
|
13 | 13 | import co.elastic.clients.elasticsearch.ilm.get_lifecycle.Lifecycle;
|
14 | 14 | import co.elastic.clients.elasticsearch.indices.ElasticsearchIndicesClient;
|
| 15 | +import co.elastic.clients.elasticsearch.indices.GetIndexResponse; |
15 | 16 | import co.elastic.clients.elasticsearch.indices.GetIndexTemplateResponse;
|
| 17 | +import co.elastic.clients.elasticsearch.indices.IndexSettings; |
| 18 | +import co.elastic.clients.elasticsearch.indices.IndexSettingsLifecycle; |
| 19 | +import co.elastic.clients.elasticsearch.indices.IndexTemplate; |
| 20 | +import co.elastic.clients.elasticsearch.indices.get_index_template.IndexTemplateItem; |
16 | 21 | import co.elastic.clients.json.jackson.JacksonJsonpMapper;
|
17 | 22 | import co.elastic.clients.transport.rest_client.RestClientTransport;
|
18 | 23 | import hudson.util.FormValidation;
|
|
35 | 40 | import java.util.ArrayList;
|
36 | 41 | import java.util.Collections;
|
37 | 42 | import java.util.List;
|
| 43 | +import java.util.Optional; |
38 | 44 | import java.util.Properties;
|
39 | 45 | import java.util.stream.Collectors;
|
40 | 46 |
|
@@ -121,6 +127,13 @@ public void testGetIndexTemplate() throws IOException {
|
121 | 127 | ElasticsearchClient elasticsearchClient = new ElasticsearchClient(elasticsearchTransport);
|
122 | 128 | ElasticsearchIndicesClient elasticsearchIndicesClient = elasticsearchClient.indices();
|
123 | 129 | GetIndexTemplateResponse indexTemplatesResponse = elasticsearchIndicesClient.getIndexTemplate(b -> b.name("logs-apm.app"));
|
| 130 | + IndexTemplate indexTemplate = indexTemplatesResponse.indexTemplates().stream().findFirst().get().indexTemplate(); |
| 131 | + |
| 132 | + IndexSettings indexTemplateSettings = indexTemplate.template().settings().index(); |
| 133 | + |
| 134 | + IndexSettingsLifecycle lifecycle = indexTemplateSettings.lifecycle(); |
| 135 | + |
| 136 | + System.out.println(lifecycle); |
124 | 137 | // TODO the rest
|
125 | 138 | }
|
126 | 139 |
|
|
0 commit comments