Skip to main content

Task Statuses

Tasks within the system represent asynchronous operations, such as deploying resources, starting or stopping containers, and other background processes. Each task has a status indicating its current state.

Available Statuses

pending

  • Description: The task has been created and is queued for execution but has not yet started. This status indicates that the task is waiting for available resources or for a previous task to complete.

in_progress

  • Description: The task is currently being executed. This status shows that the operation (e.g., rebooting a container) is actively taking place.

success

  • Description: The task has been completed successfully. This status indicates that the requested operation was executed without any issues, and the desired outcome was achieved.

failed

  • Description: The task encountered an error and could not be completed as expected. This status is accompanied by a fail_reason providing insight into what went wrong.

Status Transitions

Understanding how a task progresses through these statuses is key to managing operations within the system:

  1. From pending to in_progress: Indicates that the task has started execution.
  2. From in_progress to success: Indicates that the task was completed successfully.
  3. From in_progress to failed: Indicates that an error occurred during task execution, preventing successful completion.

Handling Task Statuses

  • Monitoring: Regularly check the status of tasks to ensure they are progressing as expected. Use the "Get Task Information" endpoint to query task statuses.
  • Error Handling: In the event of a failed status, review the fail_reason to understand the cause of failure and take appropriate corrective actions.

Example Usage

To check the status of a specific task, you might use a command like:

curl -X GET "https://api.hiveon.ai/clore/v1/tasks/{task_id}" \
-H "Accept: application/json"

Replace {task_id} with the actual ID of the task you are interested in. The response will provide the current status and, in case of failure, a reason for the failure.