From 1b6935fbf139ec5d88690bc338b069e877857f9f Mon Sep 17 00:00:00 2001 From: "Daniel (dB.) Doubrovkine" Date: Wed, 18 Dec 2024 11:50:28 -0500 Subject: [PATCH] Added missing cancellation_time_millis. (#747) Signed-off-by: dblock --- CHANGELOG.md | 1 + spec/schemas/tasks._common.yaml | 2 ++ tests/default/_core/tasks/cancel.yaml | 20 +++++++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 956b2fbc9..60c0eb3df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - 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)) +- Added missing `cancellation_time_millis` to `POST /_tasks/_cancel` ([#747](https://github.com/opensearch-project/opensearch-api-specification/pull/747)) ### 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/schemas/tasks._common.yaml b/spec/schemas/tasks._common.yaml index 7c1652589..cf6c85277 100644 --- a/spec/schemas/tasks._common.yaml +++ b/spec/schemas/tasks._common.yaml @@ -44,6 +44,8 @@ components: type: boolean cancellable: type: boolean + cancellation_time_millis: + $ref: '_common.yaml#/components/schemas/EpochTimeUnitMillis' description: type: string headers: diff --git a/tests/default/_core/tasks/cancel.yaml b/tests/default/_core/tasks/cancel.yaml index d1100f784..a024f4ff3 100644 --- a/tests/default/_core/tasks/cancel.yaml +++ b/tests/default/_core/tasks/cancel.yaml @@ -1,7 +1,20 @@ $schema: ../../../../json_schemas/test_story.schema.yaml description: Test tasks endpoint. +epilogues: + - path: /books + method: DELETE + status: [200, 404] prologues: + - path: /_bulk + method: POST + parameters: + refresh: true + request: + content_type: application/x-ndjson + payload: + - {create: {_index: books}} + - {author: Harper Lee, title: To Kill a Mockingbird, year: 1960} - path: /books/_delete_by_query id: task method: POST @@ -24,10 +37,3 @@ chapters: method: POST parameters: task_id: ${task.id} - response: - status: 200 - payload: - node_failures: - - type: failed_node_exception - caused_by: - type: resource_not_found_exception