Skip to content

Add delete task API specification - #1215

Open
cwperks wants to merge 2 commits into
opensearch-project:mainfrom
cwperks:add-delete-task-api
Open

Add delete task API specification#1215
cwperks wants to merge 2 commits into
opensearch-project:mainfrom
cwperks:add-delete-task-api

Conversation

@cwperks

@cwperks cwperks commented Aug 26, 2026

Copy link
Copy Markdown
Member

Description

Adds the API specification for DELETE /_tasks/{task_id}, introduced in OpenSearch 3.9 by opensearch-project/OpenSearch#21727.

The API deletes a stored completed task result and returns an acknowledged response. This change also extends the existing Tasks test story to wait for the asynchronous task to complete before deleting its stored result.

Related documentation: opensearch-project/documentation-website#12954

Testing

  • npm run lint:spec
  • npm run lint
  • npm run merge
  • npm run test:unit -- --runInBand
  • npm run test:spec -- --opensearch-url http://localhost:9200 --tests tests/default/_core/tasks.yaml --verbose against a locally built OpenSearch 3.9.0-SNAPSHOT cluster

The focused Tasks specification story passed, including validation of the delete response:

{
  "acknowledged": true
}

Signed-off-by: Craig Perkins <craig5008@gmail.com>
Signed-off-by: Craig Perkins <craig5008@gmail.com>

@iprithv iprithv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Hailong-am Hailong-am left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

description: The ID of the stored completed task result to delete (`node_id:task_number`).
required: true
schema:
$ref: '../schemas/_common.yaml#/components/schemas/TaskId'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: get using $ref: '../schemas/_common.yaml#/components/schemas/Id', checked definition for both, they are same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants