Tasks API

Use the Tasks API to get the status of long-running tasks.

Get the status of a long-running task

Get the status of a long-running task. Tasks to create and delete clusters are long-running tasks.

Request

Send an HTTP request with these elements.

Element Description

Method

GET

Request URI

https://cloud.lucidworks.com/managed/api/customers/customerId/tasks/taskId

Request header fields

Request header fields specify metadata for the request. For example, the Authorization header contains the OAuth2 access token.

Message body

None

Response

A response from a request to get the status of a long-running task contains these elements.

Element Description

Status line

The status line contains the status code and the reason phrase.

Response header fields

Response header fields specify metadata about the response.

Message body

JSON object that contains status information about the task and about any subtasks.

Example

Request:

curl https://cloud.lucidworks.com/managed/api/customers/lucidworks/tasks/72 -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer accessTokenManagedSearch"

Task statuses

Tasks and subtasks can have these statuses, which are keys in the JSON object in the response. The corresponding values are the number of subtasks with each status (for all statuses except failed) or the failure reasons (for the status `failed).

Status Details

total

The total number of subtasks.

success

The task or subtask suceeded.

running

The task or subtask is still running.

failed

The task or one or more subtasks failed. The reason for failure is given in the response. After correcting the reason for the failure, retry the failed task.

This is an example JSON object from a response in which one of five subtasks failed:

{
  “total” : 5,
  “success” : 2,
  “running” : 2,
  “failed” : [
    “failed to create the monitoring dashboard”
  ],
}