diff --git a/tests/cluster/component_template.yaml b/tests/cluster/component_template.yaml new file mode 100644 index 000000000..78ba7eea4 --- /dev/null +++ b/tests/cluster/component_template.yaml @@ -0,0 +1,87 @@ +$schema: ../../json_schemas/test_story.schema.yaml + +description: Test component templates. +epilogues: + - path: /_component_template/template1 + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create a component template. + path: /_component_template/{name} + method: POST + parameters: + name: template1 + request_body: + payload: + template: + settings: + number_of_shards: 1 + mappings: + _source: + enabled: false + properties: + name: + type: keyword + age: + type: integer + response: + status: 200 + - synopsis: Update a component template. + path: /_component_template/{name} + method: PUT + parameters: + name: template1 + request_body: + payload: + template: + settings: + number_of_shards: 2 + mappings: + _source: + enabled: false + properties: + name: + type: keyword + age: + type: integer + aliases: + alias1: {} + response: + status: 200 + - synopsis: Check if the component template exists. + path: /_component_template/{name} + method: HEAD + parameters: + name: template1 + cluster_manager_timeout: 10s + local: false + response: + status: 200 + - synopsis: Get all component templates. + path: /_component_template + method: GET + parameters: + cluster_manager_timeout: 10s + local: false + response: + status: 200 + - synopsis: Get a component template. + path: /_component_template/{name} + method: GET + parameters: + name: template1 + response: + status: 200 + payload: + component_templates: + - name: template1 + component_template: + template: + settings: + index: + number_of_shards: '2' + - synopsis: Delete the component template. + path: /_component_template/{name} + method: DELETE + parameters: + name: template1 diff --git a/tests/indices/data_stream.yaml b/tests/indices/data_stream.yaml index 0bf314faa..4b9d282ab 100644 --- a/tests/indices/data_stream.yaml +++ b/tests/indices/data_stream.yaml @@ -1,19 +1,9 @@ $schema: ../../json_schemas/test_story.schema.yaml description: Test data streams. -epilogues: - - path: /_data_stream/logs-nginx - method: DELETE - status: [200, 404] - - path: /_index_template/logs-template - method: DELETE - status: [200, 404] -chapters: - - synopsis: Create an index template. - path: /_index_template/{name} +prologues: + - path: /_index_template/logs-template-nginx method: PUT - parameters: - name: logs-template-nginx request_body: payload: index_patterns: @@ -23,6 +13,14 @@ chapters: timestamp_field: name: request_time priority: 100 +epilogues: + - path: /_data_stream/logs-nginx + method: DELETE + status: [200, 404] + - path: /_index_template/logs-template + method: DELETE + status: [200, 404] +chapters: - synopsis: Create a data stream. path: /_data_stream/{name} method: PUT diff --git a/tests/indices/index.yaml b/tests/indices/index.yaml index 541d76205..e91becc8e 100644 --- a/tests/indices/index.yaml +++ b/tests/indices/index.yaml @@ -51,6 +51,7 @@ chapters: method: HEAD parameters: index: movies + cluster_manager_timeout: 10s response: status: 404 @@ -78,3 +79,4 @@ chapters: method: DELETE parameters: index: books,games + cluster_manager_timeout: 10s diff --git a/tests/indices/index_template.yaml b/tests/indices/index_template.yaml index 6ab21c386..645312864 100644 --- a/tests/indices/index_template.yaml +++ b/tests/indices/index_template.yaml @@ -67,6 +67,7 @@ chapters: method: HEAD parameters: name: daily_logs + cluster_manager_timeout: 10s response: status: 200 - synopsis: Delete an index template.