# Action object

```json metadata
{
  "schema_version": 2,
  "title": "Action object",
  "description": "An object that represents cluster actions",
  "categories": ["docs","operate","rs"],
  "tableOfContents": {"sections":[]}

,
  "codeExamples": []
}
```


The cluster allows you to invoke general maintenance actions such as rebalancing or taking a node offline by moving all of its entities to other nodes.

Actions are implemented as tasks in the cluster. Every task has a unique `task_id` assigned by the cluster, a task name which describes the task, a status, and additional task-specific parameters.

The REST API provides a simplified interface that allows callers to invoke actions and query their status without a specific `task_id`.

The action lifecycle is based on the following status and status transitions:

```mermaid
stateDiagram-v2
    queued --> starting
    queued --> cancelled
    starting --> running
    starting --> aborted
    running --> completed
    running --> cancelling
    running --> failed
    running --> aborted
    cancelling --> cancelled
```

| Name | Type/Value | Description |
|------|------------|-------------|
| progress        | float <nobr>(range: 0-100)</nobr> | Represents percent completed (As of v7.4.2, the return value type changed to 'float' to provide improved progress indication) |
| status          | queued | Requested operation and added it to the queue to await processing |
|                 | starting | Picked up operation from the queue and started processing |
|                 | running | Currently executing operation |
|                 | cancelling | Operation cancellation is in progress |
|                 | cancelled | Operation cancelled |
|                 | aborted | Operation aborted |
|                 | completed | Operation completed |
|                 | failed | Operation failed |

When a task fails, the `error_code` and `error_message` fields describe the error.

Possible `error_code` values:

 Code                    | Description                                    |
|-------------------------|------------------------------------------------|
| internal_error          | An internal error that cannot be mapped to a more precise error code
| insufficient_resources  | The cluster does not have sufficient resources to complete the required operation


