--- "Put template": - do: indices.put_template: name: test body: template: test-* settings: number_of_shards: 1 number_of_replicas: 0 - do: indices.get_template: name: test flat_settings: true - match: {test.template: "test-*"} - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} --- "Put template with aliases": - do: indices.put_template: name: test body: template: test-* aliases: test_alias: {} test_blias: { routing: b } test_clias: { filter: { term: { user: kimchy }}} - do: indices.get_template: name: test - match: { test.template: "test-*" } - length: { test.aliases: 3 } - is_true: test.aliases.test_alias - match: { test.aliases.test_blias.index_routing: "b" } - match: { test.aliases.test_blias.search_routing: "b" } - match: { test.aliases.test_clias.filter.term.user: "kimchy" } --- "Put template create": - do: indices.put_template: name: test create: true body: template: test-* settings: number_of_shards: 1 number_of_replicas: 0 - do: indices.get_template: name: test flat_settings: true - match: {test.template: "test-*"} - match: {test.settings: {index.number_of_shards: '1', index.number_of_replicas: '0'}} - do: catch: request indices.put_template: name: test create: true body: template: test-* settings: number_of_shards: 1 number_of_replicas: 0