Skip to content

Commit

Permalink
fixing paths, deleting not necessary code, adding validate query api …
Browse files Browse the repository at this point in the history
…specs

Signed-off-by: Tokesh <[email protected]>
  • Loading branch information
Tokesh committed Nov 23, 2024
1 parent cf167fd commit 93a58c9
Show file tree
Hide file tree
Showing 6 changed files with 274 additions and 313 deletions.
185 changes: 0 additions & 185 deletions tests/default/indices/mapping.yaml
Original file line number Diff line number Diff line change
@@ -1,185 +0,0 @@
$schema: ../../../json_schemas/test_story.schema.yaml

description: Test mappings endpoints.
prologues:
- path: /{index}
method: PUT
parameters:
index: games
- path: /{index}
method: PUT
parameters:
index: movies
request:
payload:
mappings:
properties:
director:
type: text
year:
type: integer
location:
type: ip
ignore_malformed: true
epilogues:
- path: /movies,games
method: DELETE
status: [200, 404]
chapters:
- synopsis: Get mappings for an index.
path: /{index}/_mapping
method: GET
parameters:
index: movies
response:
status: 200
payload:
movies:
mappings:
properties:
director:
type: text
year:
type: integer
- synopsis: Get mappings for multiple indexes.
path: /{index}/_mapping
method: GET
parameters:
index: movies,games
response:
status: 200
payload:
movies:
mappings:
properties:
director:
type: text
year:
type: integer
games:
mappings: {}
- synopsis: Update mapping for an index.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: 'true'
properties:
producer:
type: text
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index (cluster_manager_timeout).
path: /{index}/_mapping
method: PUT
version: '>= 2.0'
parameters:
index: movies
cluster_manager_timeout: 1s
request:
payload:
properties:
producer:
type: text
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to false.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: 'false'
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to strict.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: strict
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to strict_allow_templates.
version: '>= 2.16'
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: strict_allow_templates
response:
status: 200
payload:
acknowledged: true
- synopsis: Add new fields to index mapping.
path: /{index}/_mapping
method: POST
parameters:
index: movies
request:
payload:
properties:
genre:
type: text
rating:
type: float
response:
status: 200
payload:
acknowledged: true
- synopsis: Get specific field mappings for an index.
path: /{index}/_mapping/field/{fields}
method: GET
parameters:
index: movies
fields: director,year
response:
status: 200
payload:
movies:
mappings:
year:
full_name: year
mapping:
year:
type: integer
director:
full_name: director
mapping:
director:
type: text
61 changes: 61 additions & 0 deletions tests/default/indices/mapping/field.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test specific field mappings endpoints.
prologues:
- path: /{index}
method: PUT
parameters:
index: movies
request:
payload:
mappings:
properties:
director:
type: text
year:
type: integer
location:
type: ip
ignore_malformed: true
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
chapters:
- synopsis: Add new fields to index mapping.
path: /{index}/_mapping
method: POST
parameters:
index: movies
request:
payload:
properties:
genre:
type: text
rating:
type: float
response:
status: 200
payload:
acknowledged: true
- synopsis: Get specific field mappings for an index.
path: /{index}/_mapping/field/{fields}
method: GET
parameters:
index: movies
fields: director,year
response:
status: 200
payload:
movies:
mappings:
year:
full_name: year
mapping:
year:
type: integer
director:
full_name: director
mapping:
director:
type: text
148 changes: 148 additions & 0 deletions tests/default/indices/mapping/index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test mappings endpoints.
prologues:
- path: /{index}
method: PUT
parameters:
index: games
- path: /{index}
method: PUT
parameters:
index: movies
request:
payload:
mappings:
properties:
director:
type: text
year:
type: integer
location:
type: ip
ignore_malformed: true
epilogues:
- path: /movies,games
method: DELETE
status: [200, 404]
chapters:
- synopsis: Get mappings for an index.
path: /{index}/_mapping
method: GET
parameters:
index: movies
response:
status: 200
payload:
movies:
mappings:
properties:
director:
type: text
year:
type: integer
- synopsis: Get mappings for multiple indexes.
path: /{index}/_mapping
method: GET
parameters:
index: movies,games
response:
status: 200
payload:
movies:
mappings:
properties:
director:
type: text
year:
type: integer
games:
mappings: {}
- synopsis: Update mapping for an index.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: 'true'
properties:
producer:
type: text
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index (cluster_manager_timeout).
path: /{index}/_mapping
method: PUT
version: '>= 2.0'
parameters:
index: movies
cluster_manager_timeout: 1s
request:
payload:
properties:
producer:
type: text
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to false.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: 'false'
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to strict.
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: strict
response:
status: 200
payload:
acknowledged: true
- synopsis: Update mapping for an index with setting dynamic to strict_allow_templates.
version: '>= 2.16'
path: /{index}/_mapping
method: PUT
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
timeout: 10s
write_index_only: true
request:
payload:
dynamic: strict_allow_templates
response:
status: 200
payload:
acknowledged: true
Loading

0 comments on commit 93a58c9

Please sign in to comment.