Cancels a task, if it can be cancelled through an API Technical preview

POST /_tasks/_cancel

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 used to limit the tasks.

  • Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false

Responses

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"
    }
  ]
}