Skip to content

Commit

Permalink
Fix: _meta request format.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jul 10, 2024
1 parent 046b7d1 commit eae12aa
Show file tree
Hide file tree
Showing 3 changed files with 190 additions and 2 deletions.
3 changes: 1 addition & 2 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ components:
type: string
Metadata:
type: object
additionalProperties:
type: object
additionalProperties: true
GeoBounds:
description: |-
A geo bounding box. It can be represented in various ways:
Expand Down
111 changes: 111 additions & 0 deletions tests/indices/component_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test component templates.
epilogues:
- path: /logs-2020-01-01
method: DELETE
status: [200, 404]
- path: /_index_template/daily_logs
method: DELETE
status: [200, 404]
- path: /_component_template/component_template1
method: DELETE
status: [200, 404]
- path: /_component_template/component_template2
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create a component template 1.
path: /_component_template/{name}
method: POST
parameters:
name: component_template_1
request_body:
payload:
template:
mappings:
properties:
'@timestamp':
type: date
response:
status: 200
- synopsis: Get component template 1.
path: /_component_template/{name}
method: GET
parameters:
name: component_template_1
response:
status: 200
- synopsis: Create a component template 2.
path: /_component_template/{name}
method: POST
parameters:
name: component_template_2
request_body:
payload:
template:
mappings:
properties:
ip_address:
type: ip
response:
status: 200
- synopsis: Create an index template composed of 2 component templates.
path: /_index_template/{name}
method: POST
parameters:
name: daily_logs
request_body:
payload:
index_patterns:
- "logs*"
template:
aliases:
my_logs: {}
settings:
number_of_shards: 2
number_of_replicas: 2
mappings:
properties:
timestamp:
type: date
format: yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis
value:
type: double
priority: 200
composed_of:
- component_template_1
- component_template_2
version: 3
_meta:
description: Template using component templates.
response:
status: 200
- synopsis: Create an index using the composite template.
path: /{index}
method: PUT
parameters:
index: logs-2020-01-01
response:
status: 200
- synopsis: Get an index using the composite template.
path: /{index}
method: GET
parameters:
index: logs-2020-01-01
response:
status: 200
- synopsis: Delete index template.
path: /_index_template/{name}
method: DELETE
parameters:
name: daily_logs
response:
status: 200
- synopsis: Delete component template 1.
path: /_component_template/{name}
method: DELETE
parameters:
name: component_template_1
response:
status: 200
78 changes: 78 additions & 0 deletions tests/indices/index_template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test index templates.
epilogues:
- path: /_index_template/daily_logs
method: DELETE
status: [200, 404]
chapters:
- synopsis: Create an index template.
path: /_index_template/{name}
method: POST
parameters:
name: daily_logs
request_body:
payload:
index_patterns:
- "logs*"
priority: 0
template:
settings:
number_of_shards: 2
number_of_replicas: 2
response:
status: 200
- synopsis: Update an index template.
path: /_index_template/{name}
method: PUT
parameters:
name: daily_logs
request_body:
payload:
index_patterns:
- "logs*"
priority: 0
template:
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 all index templates.
path: /_index_template
method: GET
response:
status: 200
- synopsis: Retrieve an index template.
path: /_index_template/{name}
method: GET
parameters:
name: daily_logs
response:
status: 200
payload:
index_templates:
- name: daily_logs
- synopsis: Check that an index template exists.
path: /_index_template/{name}
method: HEAD
parameters:
name: daily_logs
response:
status: 200
- synopsis: Delete an index template.
path: /_index_template/{name}
method: DELETE
parameters:
name: daily_logs
response:
status: 200

0 comments on commit eae12aa

Please sign in to comment.