72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
---
|
|
"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
|
|
|
|
- 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
|
|
|
|
- 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
|
|
|