Actions (Async Tasks)
Actions in Redis Enterprise represent asynchronous operations or tasks that are running or have completed. The action commands allow you to monitor and manage these background operations.
Overview
Many Redis Enterprise operations are asynchronous, returning an action ID that can be used to track progress. Actions include database creation/deletion, backup operations, imports/exports, and cluster maintenance tasks.
Available Commands
List All Actions
List all actions in the cluster with optional filtering:
# List all actions
redisctl enterprise action list
# Filter by status
redisctl enterprise action list --status completed
redisctl enterprise action list --status running
# Filter by type
redisctl enterprise action list --type bdb_backup
# Combine filters
redisctl enterprise action list --status running --type bdb_import
# Output as table
redisctl enterprise action list -o table
Get Action Details
Get detailed information about a specific action:
# Get action by UID
redisctl enterprise action get <action_uid>
# Get action with specific fields using JMESPath
redisctl enterprise action get <action_uid> -q "status"
Check Action Status
Quick status check for an action (returns just the status field):
redisctl enterprise action status <action_uid>
Cancel Running Action
Cancel a running action:
redisctl enterprise action cancel <action_uid>
List Actions for Database
List all actions for a specific database:
redisctl enterprise action list-for-bdb <bdb_uid>
# Filter by status for specific database
redisctl enterprise action list-for-bdb <bdb_uid> --status running
Action Types
Common action types you'll encounter:
bdb_create
- Database creationbdb_delete
- Database deletionbdb_update
- Database configuration updatebdb_backup
- Database backup operationbdb_import
- Database import operationbdb_export
- Database export operationcrdb_create
- Active-Active database creationnode_join
- Node joining clustercluster_recovery
- Cluster recovery operation
Action Statuses
Actions can have the following statuses:
queued
- Action is queued for executionrunning
- Action is currently executingcompleted
- Action completed successfullyfailed
- Action failed with errorscanceled
- Action was canceled
Examples
Monitor Database Creation
# Create a database (returns action_uid)
ACTION_UID=$(redisctl enterprise database create --data @db.json -q "action_uid")
# Check status
redisctl enterprise action status $ACTION_UID
# Get full details when complete
redisctl enterprise action get $ACTION_UID
List Recent Failed Actions
# List failed actions in table format
redisctl enterprise action list --status failed -o table
# Get details of a failed action
redisctl enterprise action get <failed_action_uid> -q "{error: error_message, started: start_time}"
Cancel Long-Running Import
# List running imports
redisctl enterprise action list --status running --type bdb_import
# Cancel specific import
redisctl enterprise action cancel <import_action_uid>
Monitor All Database Actions
# Watch all actions for a database
watch -n 5 "redisctl enterprise action list-for-bdb 1 -o table"
Integration with Async Operations
The action commands work seamlessly with the --wait
flag available on create/update/delete operations:
# This uses action monitoring internally
redisctl enterprise database create --data @db.json --wait
# Equivalent to manually monitoring:
ACTION_UID=$(redisctl enterprise database create --data @db.json -q "action_uid")
while [ "$(redisctl enterprise action status $ACTION_UID)" = "running" ]; do
sleep 5
done
API Versions
The action commands support both v1 and v2 API endpoints:
- v2 endpoints (
/v2/actions
) are preferred when available - v1 endpoints (
/v1/actions
) are used as fallback - Both return the same data structure
Best Practices
- Always check action status for async operations before proceeding
- Use filtering to reduce output when listing many actions
- Save action UIDs from create/update operations for tracking
- Set up monitoring for critical long-running actions
- Check failed actions for error details to diagnose issues
Related Commands
enterprise database
- Database operations that create actionsenterprise cluster
- Cluster operations that create actionsenterprise crdb
- Active-Active operations that create actions