diff --git a/CHANGELOG.md b/CHANGELOG.md index 94549cf2a..956b2fbc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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)) diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index bcbbaf8da..63a36d3d9 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -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: diff --git a/spec/schemas/_core.reindex_rethrottle.yaml b/spec/schemas/_core.reindex_rethrottle.yaml index 877dc024c..bc5ce3a8a 100644 --- a/spec/schemas/_core.reindex_rethrottle.yaml +++ b/spec/schemas/_core.reindex_rethrottle.yaml @@ -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: diff --git a/tests/default/_core/reindex/rethrottle.yaml b/tests/default/_core/reindex/rethrottle.yaml new file mode 100644 index 000000000..0f9ef01de --- /dev/null +++ b/tests/default/_core/reindex/rethrottle.yaml @@ -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 diff --git a/tests/default/indices/delete_by_query/rethrottle.yaml b/tests/default/indices/delete_by_query/rethrottle.yaml index 17507b0c3..3169ab20b 100644 --- a/tests/default/indices/delete_by_query/rethrottle.yaml +++ b/tests/default/indices/delete_by_query/rethrottle.yaml @@ -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: