Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.elasticsearch.client.indices;

import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate.DataStreamTemplate;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.test.ESTestCase;

Expand Down Expand Up @@ -75,7 +76,7 @@ private static ComposableIndexTemplate randomIndexTemplate() {
List<String> patterns = Arrays.asList(generateRandomStringArray(10, 10, false, false));
List<String> composedOf = null;
Map<String, Object> meta = null;
ComposableIndexTemplate.DataStreamTemplate dataStreamTemplate = null;
DataStreamTemplate dataStreamTemplate = null;
if (randomBoolean()) {
composedOf = Arrays.asList(generateRandomStringArray(10, 10, false, false));
}
Expand All @@ -86,7 +87,7 @@ private static ComposableIndexTemplate randomIndexTemplate() {
Long priority = randomBoolean() ? null : randomNonNegativeLong();
Long version = randomBoolean() ? null : randomNonNegativeLong();
if (randomBoolean()) {
dataStreamTemplate = new ComposableIndexTemplate.DataStreamTemplate(randomAlphaOfLength(8));
dataStreamTemplate = new DataStreamTemplate(randomAlphaOfLength(8), randomBoolean() ? randomMeta() : null);
}
return new ComposableIndexTemplate(patterns, randomTemplate(), composedOf, priority, version, meta, dataStreamTemplate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,6 @@ setup:
name: my-template1
body:
index_patterns: [simple-data-stream1]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ setup:
name: my-template1
body:
index_patterns: [simple-data-stream1]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'
- do:
Expand All @@ -22,11 +17,6 @@ setup:
name: my-template2
body:
index_patterns: [simple-data-stream2]
template:
mappings:
properties:
'@timestamp2':
type: date
data_stream:
timestamp_field: '@timestamp2'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
name: my-template
body:
index_patterns: [logs-*]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
settings:
number_of_shards: 1
number_of_replicas: 0
mappings:
properties:
timestamp:
type: date

- do:
index:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ setup:
name: logs_template
body:
index_patterns: logs-foobar
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ setup:
name: my-template
body:
index_patterns: [simple-*]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
name: my-template
body:
index_patterns: [data-*]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@
name: my-template1
body:
index_patterns: [simple-data-stream1]
template:
mappings:
properties:
'@timestamp':
type: date
data_stream:
timestamp_field: '@timestamp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,18 @@
import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.admin.indices.template.delete.DeleteComposableIndexTemplateAction;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.admin.indices.template.put.PutComposableIndexTemplateAction;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.ingest.PutPipelineRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.action.support.replication.ReplicationRequest;
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
import org.elasticsearch.cluster.metadata.DataStream;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.cluster.metadata.ComposableIndexTemplate;
import org.elasticsearch.cluster.metadata.Template;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.compress.CompressedXContent;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentType;
Expand All @@ -68,7 +66,6 @@
import static org.elasticsearch.action.DocWriteResponse.Result.CREATED;
import static org.elasticsearch.action.DocWriteResponse.Result.UPDATED;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.cluster.metadata.MetadataCreateDataStreamServiceTests.generateMapping;
import static org.elasticsearch.test.StreamsUtils.copyToStringFromClasspath;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.hamcrest.Matchers.arrayWithSize;
Expand Down Expand Up @@ -226,7 +223,7 @@ public void testMixedAutoCreate() throws Exception {
createTemplateRequest.indexTemplate(
new ComposableIndexTemplate(
List.of("logs-foo*"),
new Template(null, new CompressedXContent(generateMapping("@timestamp")), null),
null,
null, null, null, null,
new ComposableIndexTemplate.DataStreamTemplate("@timestamp"))
);
Expand Down
Loading