Cancels a task, if it can be cancelled through an API Technical preview
Query parameters
-
actions string | array[string]
Comma-separated list or wildcard expression of actions used to limit the request.
-
nodes array[string]
Comma-separated list of node IDs or names used to limit the request.
-
parent_task_id string
Parent task ID used to limit the tasks.
-
wait_for_completion boolean
Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false
POST /_tasks/_cancel
curl \
-X POST http://api.example.com/_tasks/_cancel
Response examples (200)
{
"node_failures": [
{
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
}
],
"task_failures": [
{
"task_id": 42.0,
"node_id": "string",
"status": "string",
"reason": {
"type": "string",
"reason": "string",
"stack_trace": "string",
"caused_by": {},
"root_cause": [
{}
],
"suppressed": [
{}
]
}
}
],
"nodes": {
"additionalProperty1": {
"name": "string",
"transport_address": "string",
"host": "string",
"ip": "string",
"roles": [
"string"
],
"attributes": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"tasks": {
"additionalProperty1": {
"action": "string",
"cancelled": true,
"cancellable": true,
"description": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"id": 42.0,
"node": "string",
"running_time": "string",
"": "string",
"status": {},
"type": "string"
},
"additionalProperty2": {
"action": "string",
"cancelled": true,
"cancellable": true,
"description": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"id": 42.0,
"node": "string",
"running_time": "string",
"": "string",
"status": {},
"type": "string"
}
}
},
"additionalProperty2": {
"name": "string",
"transport_address": "string",
"host": "string",
"ip": "string",
"roles": [
"string"
],
"attributes": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"tasks": {
"additionalProperty1": {
"action": "string",
"cancelled": true,
"cancellable": true,
"description": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"id": 42.0,
"node": "string",
"running_time": "string",
"": "string",
"status": {},
"type": "string"
},
"additionalProperty2": {
"action": "string",
"cancelled": true,
"cancellable": true,
"description": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"id": 42.0,
"node": "string",
"running_time": "string",
"": "string",
"status": {},
"type": "string"
}
}
}
},
"": [
{
"action": "string",
"cancelled": true,
"cancellable": true,
"description": "string",
"headers": {
"additionalProperty1": "string",
"additionalProperty2": "string"
},
"id": 42.0,
"node": "string",
"running_time": "string",
"": "string",
"status": {},
"type": "string"
}
]
}