Skip to content

Commit

Permalink
The primary_only and wait_for_completion parameters were introduced i…
Browse files Browse the repository at this point in the history
…n 2.13 and 2.7 respectively.

Signed-off-by: dblock <dblock@amazon.com>
  • Loading branch information
dblock committed Jul 11, 2024
1 parent 594a9d3 commit c1acefd
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 21 deletions.
2 changes: 1 addition & 1 deletion SPECIFICATION_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ It's common to add a feature to the next version of OpenSearch. When adding a ne
```yaml
- synopsis: Search with `phase_took` added in OpenSearch 2.12.
version: '>= 2.12.0'
version: '>= 2.12'
path: /{index}/_search
parameters:
index: movies
Expand Down
2 changes: 1 addition & 1 deletion json_schemas/test_story.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ definitions:

Version:
description: |
The semver range to execute the chapter against.
The semver range to execute the story or chapter against.
type: string

RequestBody:
Expand Down
7 changes: 7 additions & 0 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2866,6 +2866,7 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/WaitForActiveShards'
style: form
indices.clone::query.wait_for_completion:
x-version-added: '2.7'
name: wait_for_completion
in: query
description: Should this request wait until the operation has completed before returning.
Expand Down Expand Up @@ -3516,6 +3517,7 @@ components:
type: boolean
style: form
indices.forcemerge::query.primary_only:
x-version-added: '2.13'
name: primary_only
in: query
description: Specify whether the operation should only perform on primary shards. Defaults to false.
Expand All @@ -3524,6 +3526,7 @@ components:
default: false
description: Specify whether the operation should only perform on primary shards. Defaults to false.
indices.forcemerge::query.wait_for_completion:
x-version-added: '2.7'
in: query
name: wait_for_completion
description: Should the request wait until the force merge is completed.
Expand Down Expand Up @@ -4099,6 +4102,7 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/WaitForActiveShards'
style: form
indices.open::query.wait_for_completion:
x-version-added: '2.7'
name: wait_for_completion
in: query
description: Should this request wait until the operation has completed before returning.
Expand Down Expand Up @@ -4709,6 +4713,7 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/WaitForActiveShards'
style: form
indices.shrink::query.wait_for_completion:
x-version-added: '2.7'
name: wait_for_completion
in: query
description: Should this request wait until the operation has completed before returning.
Expand Down Expand Up @@ -4875,6 +4880,7 @@ components:
$ref: '../schemas/_common.yaml#/components/schemas/WaitForActiveShards'
style: form
indices.split::query.wait_for_completion:
x-version-added: '2.7'
name: wait_for_completion
in: query
description: Should this request wait until the operation has completed before returning.
Expand Down Expand Up @@ -5037,6 +5043,7 @@ components:
type: boolean
description: If true, only ancient (an older Lucene major release) segments will be upgraded.
indices.upgrade::query.wait_for_completion:
x-version-added: '2.7'
name: wait_for_completion
in: query
description: Should this request wait until the operation has completed before returning.
Expand Down
2 changes: 1 addition & 1 deletion tests/_core/search.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ chapters:
response:
status: 200
- synopsis: Search with phase_took.
version: '>= 2.12.0'
version: '>= 2.12'
path: /{index}/_search
parameters:
index: movies
Expand Down
2 changes: 1 addition & 1 deletion tests/cat/fielddata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ chapters:
response:
status: 200
- synopsis: Cat with a json response (from security-analytics).
version: '>= 2.4.0'
version: '>= 2.4'
path: /_cat/fielddata
method: GET
parameters:
Expand Down
2 changes: 1 addition & 1 deletion tests/cat/pit_segments.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test cat/pit_segments endpoints.
version: '>= 2.4.0'
version: '>= 2.4'
epilogues:
- path: /games
method: DELETE
Expand Down
2 changes: 1 addition & 1 deletion tests/cat/segment_replication.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$schema: ../../json_schemas/test_story.schema.yaml

description: Test cat/segment_replication endpoints.
version: '>= 2.7.0'
version: '>= 2.7'
chapters:
- synopsis: Cat with a json response.
path: /_cat/segment_replication
Expand Down
2 changes: 1 addition & 1 deletion tests/indices/cache.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ chapters:
payload:
_shards: {}
- synopsis: Clear all cache, file=true (POST).
version: '>= 2.8.0'
version: '>= 2.8'
path: /_cache/clear
method: POST
parameters:
Expand Down
11 changes: 10 additions & 1 deletion tests/indices/clone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,19 @@ chapters:
wait_for_active_shards: 1
cluster_manager_timeout: 10s
timeout: 10s
wait_for_completion: true
response:
status: 200
payload:
shards_acknowledged: true
acknowledged: true
index: games
- synopsis: Clone an index (wait_for_completion).
version: '>= 2.7'
path: /{index}/_clone/{target}
method: POST
parameters:
index: movies
target: games
wait_for_completion: true
response:
status: 200
17 changes: 16 additions & 1 deletion tests/indices/forcemerge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,27 @@ chapters:
flush: true
max_num_segments: 1
only_expunge_deletes: true
primary_only: false
ignore_unavailable: true
response:
status: 200
payload:
_shards: {}
- synopsis: Force merge all indexes (primary_only).
version: '>= 2.13'
path: /_forcemerge
method: POST
parameters:
primary_only: true
response:
status: 200
- synopsis: Force merge all indexes (wait_for_completion).
version: '>= 2.7'
path: /_forcemerge
method: POST
parameters:
wait_for_completion: true
response:
status: 200
- synopsis: Force merge an index.
path: /{index}/_forcemerge
method: POST
Expand Down
9 changes: 1 addition & 8 deletions tests/indices/open.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,18 @@ chapters:
wait_for_active_shards: 0
cluster_manager_timeout: 30s
timeout: 30s
wait_for_completion: true
response:
status: 200
payload:
shards_acknowledged: true
acknowledged: true
- synopsis: Open a closed index (wait_for_completion=false).
version: '>= 2.7'
path: /{index}/_open
method: POST
parameters:
index: movies
allow_no_indices: true
expand_wildcards: all
ignore_unavailable: true
wait_for_active_shards: 0
cluster_manager_timeout: 30s
timeout: 30s
wait_for_completion: false
task_execution_timeout: 1m
response:
status: 200
- synopsis: Open an already opened index.
Expand Down
12 changes: 10 additions & 2 deletions tests/indices/shrink.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,22 @@ chapters:
wait_for_active_shards: 1
cluster_manager_timeout: 10s
timeout: 10s
wait_for_completion: true
response:
status: 200
payload:
shards_acknowledged: true
acknowledged: true
index: movies1
- synopsis: Shrink an index (wait_for_completion).
version: '>= 2.7'
path: /{index}/_shrink/{target}
method: POST
parameters:
index: movies
target: movies1
wait_for_completion: true
response:
status: 200
- synopsis: Shrink an index (PUT).
path: /{index}/_shrink/{target}
method: PUT
Expand All @@ -53,7 +62,6 @@ chapters:
wait_for_active_shards: 1
cluster_manager_timeout: 10s
timeout: 10s
wait_for_completion: true
response:
status: 200
payload:
Expand Down
17 changes: 15 additions & 2 deletions tests/indices/split.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ chapters:
wait_for_active_shards: 1
cluster_manager_timeout: 10s
timeout: 10s
wait_for_completion: true
request_body:
payload:
settings:
Expand All @@ -49,6 +48,21 @@ chapters:
shards_acknowledged: true
acknowledged: true
index: movies1
- synopsis: Split an index (wait_for_completion).
version: '>= 2.7'
path: /{index}/_split/{target}
method: POST
parameters:
index: movies
target: movies1
wait_for_completion: true
request_body:
payload:
settings:
index:
number_of_shards: 6
response:
status: 200
- synopsis: Split an index (PUT).
path: /{index}/_split/{target}
method: PUT
Expand All @@ -58,7 +72,6 @@ chapters:
wait_for_active_shards: 1
cluster_manager_timeout: 10s
timeout: 10s
wait_for_completion: true
request_body:
payload:
settings:
Expand Down

0 comments on commit c1acefd

Please sign in to comment.