From 150159b5cf0e5c71015a2653aea3074bda06bb47 Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Tue, 17 Dec 2024 08:10:36 -0500 Subject: [PATCH] Added tests for /_template/{name}. (#736) Signed-off-by: dblock --- tests/default/_core/template.yaml | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 tests/default/_core/template.yaml diff --git a/tests/default/_core/template.yaml b/tests/default/_core/template.yaml new file mode 100644 index 00000000..4096d956 --- /dev/null +++ b/tests/default/_core/template.yaml @@ -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