Back to Redis

Index

content/operate/rs/references/rest-api/requests/actions/_index.md

latest15.2 KB
Original Source
MethodPathDescription
GET/v1/actionsGet all actions
GET/v2/actionsGet all actions
GET/v1/actions/{uid}Get a single action
GET/v2/actions/{uid}Get a single action

Get all actions v1 {#get-all-actions}

GET /v1/actions

Get the status of all running, pending, or completed actions on all clusters, nodes, and databases. This API tracks long-lived API requests that return either a task_id or an action_uid.

This API does not return any information about other actions, such as import, export, and backup. To get info about these actions, use GET /v2/actions.

Required permissions

Permission name
[view_status_of_cluster_action]({{< relref "/operate/rs/references/rest-api/permissions#view_status_of_cluster_action" >}})

Request {#get-all-request}

Example HTTP request

GET /v1/actions

Response {#get-all-response}

Returns a JSON array of [action objects]({{< relref "/operate/rs/references/rest-api/objects/action" >}}), which represent tasks, and an array of [state-machine objects]({{< relref "/operate/rs/references/rest-api/objects/state-machine" >}}).

FieldType/ValueDescription
action_uidstringThe action's globally unique identifier
namestringName of the running or failed state machine
progressfloat (range: 0-100)Percent of completed steps for the action
status"pending"
"active"
"completed"
"failed"The action's status
node_uidstringUID of the node where the operation runs (optional)
object_namestringThe object that the action runs on (optional)
statestringThe current state of the state machine (optional)
pending_opsJSON objectList of operations that are waiting to run (optional)
{{<code>}}"pending_ops": {
"3": {
"heartbeat": integer,
"snapshot": { ... },
"last_sample_time": integer,
"op_name": string,
"status_code": string,
"status_description": string,
"progress": float

} }{{</code>}} pending_ops is a map where the key is the shard_id, and the value is a map that can include the following optional fields: heartbeat: The time, in seconds since the Unix epoch, since the last change in the progress of the operation. snapshot: A map of properties stored by the operation that are needed to run. last_sample_time: The time, in seconds since the Unix epoch, when the last snapshot of the operation was taken. op_name: The name of the operation from the state machine that is running. status_code: The code for the operation's current status. status_description: The operation's current status. progress: The operation's progress in percentage (1 to 100). |

Regardless of an action’s source, each action in the response contains the following attributes: name, action_uid, status, and progress.

Example JSON body

json
{
  "actions": [
    {
      "action_uid": "159ca2f8-7bf3-4cda-97e8-4eb560665c28",
      "name": "retry_bdb",
      "node_uid": "2",
      "progress": "100",
      "status": "completed",
      "task_id": "159ca2f8-7bf3-4cda-97e8-4eb560665c28"
    },
    {
      "action_uid": "661697c5-c747-41bd-ab81-ffc8fd13c494",
      "name": "retry_bdb",
      "node_uid": "1",
      "progress": "100",
      "status": "completed",
      "task_id": "661697c5-c747-41bd-ab81-ffc8fd13c494"
    }
  ],
  "state-machines": [
    {
      "action_uid": "a10586b1-60bc-428e-9bc6-392eb5f0d8ae",
      "heartbeat": 1650378874,
      "name": "SMCreateBDB",
      "object_name": "bdb:1",
      "progress": 100,
      "status": "completed"
    }
  ]
}

Status codes {#get-all-status-codes}

CodeDescription
200 OKNo error, response provides info about an ongoing action
404 Not FoundAction does not exist (for example, not currently running and no available status of last run).

Get all actions v2 {#get-all-actions-v2}

GET /v2/actions

Get the status of all currently running, pending, or completed actions from tasks, state-machines, and other actions, including import, export, and backup. This API tracks long-lived API requests that return either a task_id or an action_uid.

Required permissions

Permission name
[view_status_of_cluster_action]({{< relref "/operate/rs/references/rest-api/permissions#view_status_of_cluster_action" >}})

Request {#get-all-request-v2}

Example HTTP request

GET /v2/actions

Response {#get-all-response-v2}

Returns a JSON array of v2 [action objects]({{< relref "/operate/rs/references/rest-api/objects/action" >}}).

The v2 action object includes the following fields:

FieldType/ValueDescription
action_uidstringThe action's globally unique identifier
action_type"task"
"state-machine"
"other"The action's type
creation_timeintegerThe action's creation time. Unix timestamp in seconds.
namestringName of the running or failed state machine
progressfloat (range: 0-100)Percent of completed steps for the action
status"queued"
"running"
"completed"
"failed"The action's status
additional_infoJSON objectA dictionary that can include additional information about the action; only included in the response if it contains at least one key-value pair

The additional_info object can contain any of the following fields:

FieldType/ValueDescription
descriptionstringShort description of the action
errorstringA message that describes what error occurred if the action failed
object_typestringThe type of object that was processed in the action, such as BDB or node
object_uidstringThe unique ID of the object processed in the action
pending_opsJSON objectList of operations that are waiting to run (optional)
{{<code>}}"pending_ops": {
"3": {
"heartbeat": integer,
"snapshot": { ... },
"last_sample_time": integer,
"op_name": string,
"status_code": string,
"status_description": string,
"progress": float

} }{{</code>}} pending_ops is a map where the key is the shard_id, and the value is a map that can include the following optional fields: heartbeat: The time, in seconds since the Unix epoch, since the last change in the progress of the operation. snapshot: A map of properties stored by the operation that are needed to run. last_sample_time: last_sample_time: The time, in seconds since the Unix epoch, when the last snapshot of the operation was taken. op_name: The name of the operation from the state machine that is running. status_code: The code for the operation's current status. status_description: The operation's current status. progress: The operation's progress in percentage (1 to 100). |

Regardless of an action’s source, each action in the response contains the following attributes: name, action_uid, creation_time, status, and progress.

Example JSON body

json
[
    {
        "action_type": "task",
        "action_uid": "6155403f-c26f-40ab-8afc-23ed663973f6",
        "additional_info": {
            "object_type": "node",
            "object_uid": "1"
        },
        "creation_time": 1742595918,
        "name": "retry_bdb",
        "progress": 100.0,
        "status": "completed"
    },
    // Additional task objects
]

Status codes {#get-all-status-codes-v2}

CodeDescription
200 OKNo error, response provides info about an ongoing action

Get a specific action v1 {#get-action}

GET /v1/actions/{uid}

Get the status of a specific action.

This API does not return any information about other actions, such as import, export, and backup. To get info about these actions, use GET /v2/actions/<uid>.

Required permissions

Permission name
[view_status_of_cluster_action]({{< relref "/operate/rs/references/rest-api/permissions#view_status_of_cluster_action" >}})

Request {#get-request}

Example HTTP request

GET /v1/actions/{uid}

URL parameters

FieldTypeDescription
uidstringThe action_uid to check

Response {#get-response}

Returns an [action object]({{< relref "/operate/rs/references/rest-api/objects/action" >}}).

FieldType/ValueDescription
action_uidstringThe action's globally unique identifier
namestringName of the running or failed state machine
progressfloat (range: 0-100)Percent of completed steps for the action
status"pending"
"active"
"completed"
"failed"The action's status
node_uidstringUID of the node where the operation runs (optional)
object_namestringThe object that the action runs on (optional)
statestringThe current state of the state machine (optional)
pending_opsJSON objectList of operations that are waiting to run (optional)
{{<code>}}"pending_ops": {
"3": {
"heartbeat": integer,
"snapshot": { ... },
"last_sample_time": integer,
"op_name": string,
"status_code": string,
"status_description": string,
"progress": float

} }{{</code>}} pending_ops is a map where the key is the shard_id, and the value is a map that can include the following optional fields: heartbeat: The time, in seconds since the Unix epoch, since the last change in the progress of the operation. snapshot: A map of properties stored by the operation that are needed to run. last_sample_time: The time, in seconds since the Unix epoch, when the last snapshot of the operation was taken. op_name: The name of the operation from the state machine that is running. status_code: The code for the operation's current status. status_description: The operation's current status. progress: The operation's progress in percentage (1 to 100). |

Regardless of an action’s source, each action contains the following attributes: name, action_uid, status, and progress.

Example JSON body

json
{
  "action_uid": "159ca2f8-7bf3-4cda-97e8-4eb560665c28",
  "name": "retry_bdb",
  "node_uid": "2",
  "progress": "100",
  "status": "completed",
  "task_id": "159ca2f8-7bf3-4cda-97e8-4eb560665c28"
}

Status codes {#get-status-codes}

CodeDescription
200 OKNo error, response provides info about an ongoing action
404 Not FoundAction does not exist (that is, not currently running and no available status of last run)

Get a specific action v2 {#get-action-v2}

GET /v2/actions/{uid}

Get the status of a specific action. This API can also return information about actions like import, export, and backup.

Required permissions

Permission name
[view_status_of_cluster_action]({{< relref "/operate/rs/references/rest-api/permissions#view_status_of_cluster_action" >}})

Request {#get-request-v2}

Example HTTP request

GET /v2/actions/{uid}

URL parameters

FieldTypeDescription
uidstringThe action_uid to check

Response {#get-response-v2}

Returns a v2 [action object]({{<relref "/operate/rs/references/rest-api/objects/action">}}).

The v2 action object includes the following fields:

FieldType/ValueDescription
action_uidstringThe action's globally unique identifier
action_type"task"
"state-machine"
"other"The action's type
creation_timeintegerThe action's creation time. Unix timestamp in seconds.
namestringName of the running or failed state machine
progressfloat (range: 0-100)Percent of completed steps for the action
status"queued"
"running"
"completed"
"failed"The action's status
additional_infoJSON objectA dictionary that can include additional information about the action; only included in the response if it contains at least one key-value pair

The additional_info object can contain any of the following fields:

FieldType/ValueDescription
descriptionstringShort description of the action
errorstringA message that describes what error occurred if the action failed
object_typestringThe type of object that was processed in the action, such as BDB or node
object_uidstringThe unique ID of the object processed in the action
pending_opsJSON objectList of operations that are waiting to run (optional)
{{<code>}}"pending_ops": {
"3": {
"heartbeat": integer,
"snapshot": { ... },
"last_sample_time": integer,
"op_name": string,
"status_code": string,
"status_description": string,
"progress": float

} }{{</code>}} pending_ops is a map where the key is the shard_id, and the value is a map that can include the following optional fields: heartbeat: The time, in seconds since the Unix epoch, since the last change in the progress of the operation. snapshot: A map of properties stored by the operation that are needed to run. last_sample_time: The time, in seconds since the Unix epoch, when the last snapshot of the operation was taken. op_name: The name of the operation from the state machine that is running. status_code: The code for the operation's current status. status_description: The operation's current status. progress: The operation's progress in percentage (1 to 100). |

Regardless of an action’s source, each action contains the following attributes: name, action_uid, creation_time, status, and progress.

Example JSON body

json
{
    "action_type": "task",
    "action_uid": "6155403f-c26f-40ab-8afc-23ed663973f6",
    "additional_info": {
        "object_type": "node",
        "object_uid": "1"
    },
    "creation_time": 1742595918,
    "name": "retry_bdb",
    "progress": 100.0,
    "status": "completed"
}

Status codes {#get-status-codes-v2}

CodeDescription
200 OKNo error, response provides info about an ongoing action
404 Not FoundAction does not exist (that is, not currently running and no available status of last run)