feat(cloud): add --wait flag to async database operations #191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements the
--waitflag for Cloud database operations that return task IDs, allowing users to wait for operations to complete without having to manually run separate task commands.Fixes #175 (partially - database commands only in this PR)
Background
Many Cloud API operations are asynchronous and return task IDs. Previously, users had to:
create database)redisctl cloud task wait <task-id>separatelyThis enhancement streamlines the workflow by allowing operations to optionally wait for completion.
What's Changed
Core Infrastructure
async_utilsmodule with shared utilities for handling async operationsAsyncOperationArgsstruct for--wait,--wait-timeout, and--wait-intervalflagshandle_async_response()to optionally wait for task completion with progress indicatorstask.rsDatabase Commands Updated
cloud database create- Creating databasescloud database update- Updating database configurationcloud database delete- Deleting databasescloud database backup- Triggering manual backupscloud database import- Importing dataUsage Examples
Without --wait (existing behavior)
With --wait (new behavior)
Custom timeout and interval
Testing
Future Work
This PR implements the foundation with database commands. Follow-up PRs will add --wait support to:
Breaking Changes
None - this is purely additive functionality. All existing commands work exactly as before when --wait is not specified.