Skip to content

Commit

Permalink
Added tests for /_template/{name}. (opensearch-project#736)
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
Signed-off-by: Nathalie Jonathan <[email protected]>
  • Loading branch information
dblock authored and nathaliellenaa committed Dec 18, 2024
1 parent d989004 commit 58a2451
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions tests/default/_core/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test templates.
epilogues:
- path: /_template/daily_logs
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create a template.
path: /_template/{name}
method: POST
parameters:
name: daily_logs
request:
payload:
index_patterns:
- 'logs*'
settings:
number_of_shards: 2
number_of_replicas: 2
response:
status: 200
- synopsis: Update a template.
path: /_template/{name}
method: PUT
parameters:
name: daily_logs
request:
payload:
index_patterns:
- 'logs*'
aliases:
my_logs: {}
settings:
number_of_shards: 4
number_of_replicas: 4
mappings:
properties:
timestamp:
type: date
format: yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
value:
type: double
response:
status: 200
- synopsis: Retrieve templates.
path: /_template
method: GET
- synopsis: Retrieve a template.
path: /_template/{name}
method: GET
parameters:
name: daily_logs
response:
status: 200
payload:
daily_logs:
index_patterns:
- logs*
settings:
index:
number_of_shards: '4'
number_of_replicas: '4'
- synopsis: Check that a template exists.
path: /_template/{name}
method: HEAD
parameters:
name: daily_logs
- synopsis: Delete a template.
path: /_template/{name}
method: DELETE
parameters:
name: daily_logs

0 comments on commit 58a2451

Please sign in to comment.