Skip to content

Commit 0f2c91f

Browse files
dblocknathaliellenaa
authored andcommitted
Added tests for /_template/{name}. (opensearch-project#736)
Signed-off-by: dblock <[email protected]>
1 parent 13b02f5 commit 0f2c91f

File tree

1 file changed

+73
-0
lines changed

1 file changed

+73
-0
lines changed

tests/default/_core/template.yaml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
$schema: ../../../json_schemas/test_story.schema.yaml
2+
3+
description: Test templates.
4+
epilogues:
5+
- path: /_template/daily_logs
6+
method: DELETE
7+
status: [200, 404]
8+
chapters:
9+
- synopsis: Create a template.
10+
path: /_template/{name}
11+
method: POST
12+
parameters:
13+
name: daily_logs
14+
request:
15+
payload:
16+
index_patterns:
17+
- 'logs*'
18+
settings:
19+
number_of_shards: 2
20+
number_of_replicas: 2
21+
response:
22+
status: 200
23+
- synopsis: Update a template.
24+
path: /_template/{name}
25+
method: PUT
26+
parameters:
27+
name: daily_logs
28+
request:
29+
payload:
30+
index_patterns:
31+
- 'logs*'
32+
aliases:
33+
my_logs: {}
34+
settings:
35+
number_of_shards: 4
36+
number_of_replicas: 4
37+
mappings:
38+
properties:
39+
timestamp:
40+
type: date
41+
format: yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
42+
value:
43+
type: double
44+
response:
45+
status: 200
46+
- synopsis: Retrieve templates.
47+
path: /_template
48+
method: GET
49+
- synopsis: Retrieve a template.
50+
path: /_template/{name}
51+
method: GET
52+
parameters:
53+
name: daily_logs
54+
response:
55+
status: 200
56+
payload:
57+
daily_logs:
58+
index_patterns:
59+
- logs*
60+
settings:
61+
index:
62+
number_of_shards: '4'
63+
number_of_replicas: '4'
64+
- synopsis: Check that a template exists.
65+
path: /_template/{name}
66+
method: HEAD
67+
parameters:
68+
name: daily_logs
69+
- synopsis: Delete a template.
70+
path: /_template/{name}
71+
method: DELETE
72+
parameters:
73+
name: daily_logs

0 commit comments

Comments
 (0)