Skip to content

Commit

Permalink
Added missing cancelled and resource_stats to `/_reindex/{task_id…
Browse files Browse the repository at this point in the history
…}/_rethrottle`. (#740)

Signed-off-by: dblock <[email protected]>
Signed-off-by: Daniel (dB.) Doubrovkine <[email protected]>
  • Loading branch information
dblock authored Dec 17, 2024
1 parent 4226d83 commit 051e042
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added support for multiple test verbs ([#724](https://github.com/opensearch-project/opensearch-api-specification/pull/724))
- Added support for using a certificate and key in tests ([#731](https://github.com/opensearch-project/opensearch-api-specification/pull/731))
- Added `_type` to `termvector` and `mtermvector` ([#734](https://github.com/opensearch-project/opensearch-api-specification/pull/734))
- Added missing `cancelled` and `resource_stats` to `/_reindex/{task_id}/_rethrottle` ([#740](https://github.com/opensearch-project/opensearch-api-specification/pull/740))

### Removed
- Removed unsupported `_common.mapping:SourceField`'s `mode` field and associated `_common.mapping:SourceFieldMode` enum ([#652](https://github.com/opensearch-project/opensearch-api-specification/pull/652))
Expand Down
2 changes: 1 addition & 1 deletion spec/namespaces/_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ paths:
operationId: reindex_rethrottle.0
x-operation-group: reindex_rethrottle
x-version-added: '1.0'
description: Changes the number of requests per second for a particular Reindex operation.
description: Changes the number of requests per second for a particular reindex operation.
externalDocs:
url: https://opensearch.org/docs/latest
parameters:
Expand Down
4 changes: 4 additions & 0 deletions spec/schemas/_core.reindex_rethrottle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ components:
type: string
cancellable:
type: boolean
cancelled:
type: boolean
description:
type: string
id:
type: number
node:
$ref: '_common.yaml#/components/schemas/Name'
resource_stats:
$ref: '_common.yaml#/components/schemas/ResourceStats'
running_time_in_nanos:
$ref: '_common.yaml#/components/schemas/DurationValueUnitNanos'
start_time_in_millis:
Expand Down
44 changes: 44 additions & 0 deletions tests/default/_core/reindex/rethrottle.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
$schema: ../../../../json_schemas/test_story.schema.yaml

description: Test changing the number of requests per second for a particular reindex operation.
epilogues:
- path: /movies
method: DELETE
status: [200, 404]
- path: /videos
method: DELETE
status: [200, 404]
prologues:
- path: /{index}/_doc
method: POST
parameters:
index: movies
refresh: true
request:
payload:
title: Beauty and the Beast
year: 91
status: [201]
- id: task
path: /_reindex
method: POST
parameters:
wait_for_completion: false
requests_per_second: 1
request:
payload:
source:
index: movies
dest:
index: videos
output:
task_id: payload.task
chapters:
- synopsis: Change the value of `requests_per_second` on a running reindex.
path: /_reindex/{task_id}/_rethrottle
method: POST
parameters:
task_id: ${task.task_id}
requests_per_second: 2
response:
status: 200
2 changes: 1 addition & 1 deletion tests/default/indices/delete_by_query/rethrottle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ prologues:
output:
task_id: payload.task
chapters:
- synopsis: Change the value of `requests_per_second``on a running delete by query.
- synopsis: Change the value of `requests_per_second` on a running delete by query.
path: /_delete_by_query/{task_id}/_rethrottle
method: POST
parameters:
Expand Down

0 comments on commit 051e042

Please sign in to comment.