Skip to content

Conversation

@joshrotenberg
Copy link
Collaborator

@joshrotenberg joshrotenberg commented Sep 7, 2025

Description

This PR adds support for the --wait flag to Cloud connectivity commands (VPC Peering, PSC, TGW), allowing users to wait for async network operations to complete. Network operations can take 5-15 minutes, so this feature provides progress indicators and automatic polling.

Changes

  • ✅ Added AsyncOperationArgs to VPC Peering commands (6 commands: create, update, delete + Active-Active variants)
  • ✅ Added AsyncOperationArgs to PSC commands (9 commands: service and endpoint operations + Active-Active variants)
  • ✅ Added AsyncOperationArgs to TGW commands (7 commands: attachment operations + Active-Active variants)
  • ✅ Updated all VPC Peering handlers to use handle_async_response utility
  • ✅ Updated all PSC handlers to use handle_async_response utility
  • ✅ Updated all TGW handlers to use handle_async_response utility
  • ✅ Added ConnectivityOperationParams struct to address clippy too_many_arguments warnings
  • ✅ Refactored all connectivity functions to use the new parameter struct

Status

Complete - All connectivity commands now support the --wait flag with proper async operation handling.

Commands Updated

VPC Peering (✅ Complete)

  • redisctl cloud connectivity vpc-peering create --wait
  • redisctl cloud connectivity vpc-peering update --wait
  • redisctl cloud connectivity vpc-peering delete --wait
  • redisctl cloud connectivity vpc-peering create-aa --wait
  • redisctl cloud connectivity vpc-peering update-aa --wait
  • redisctl cloud connectivity vpc-peering delete-aa --wait

PSC (✅ Complete)

  • redisctl cloud connectivity psc service-create --wait
  • redisctl cloud connectivity psc service-delete --wait
  • redisctl cloud connectivity psc endpoint-create --wait
  • redisctl cloud connectivity psc endpoint-update --wait
  • redisctl cloud connectivity psc endpoint-delete --wait
  • Plus Active-Active variants

TGW (✅ Complete)

  • redisctl cloud connectivity tgw attachment-create --wait
  • redisctl cloud connectivity tgw attachment-update --wait
  • redisctl cloud connectivity tgw attachment-delete --wait
  • Plus Active-Active variants

Code Quality Improvements

  • Introduced ConnectivityOperationParams struct to group common parameters
  • Reduced function parameters from 8-10 down to 2-4 arguments
  • Fixed all clippy warnings related to too_many_arguments
  • Removed unused imports

Testing

  • All existing tests pass
  • Manual testing recommended for async operations with actual Cloud API

Related Issues

Closes #196 (connectivity commands)
Part of #175 (overall --wait flag implementation)

- Add AsyncOperationArgs to VPC Peering commands (6 commands)
- Add AsyncOperationArgs to PSC commands (9 commands)
- Add AsyncOperationArgs to TGW commands (7 commands)
- Update VPC Peering handlers to use handle_async_response
- Update match arms for PSC and TGW to include async_ops parameter
- Add async_utils import to connectivity modules

Note: This is a work in progress. Function signatures need updating for PSC and TGW handler implementations.

Part of #196
…mands

- Updated all PSC handler functions to use handle_async_response
- Updated all VPC Peering handlers (already done in previous commit)
- Updated TGW handler function signatures to accept ConnectionManager
- Replaced manual task ID handling with handle_async_response utility
- All connectivity commands now support --wait, --wait-timeout, and --wait-interval flags

Completes implementation for:
- VPC Peering: 6 commands (create, update, delete + Active-Active variants)
- PSC: 9 commands (service and endpoint operations + Active-Active variants)
- TGW: 7 commands (attachment operations + Active-Active variants)

Part of #196
Closes #196
@joshrotenberg joshrotenberg marked this pull request as ready for review September 7, 2025 13:55
- Add ConnectivityOperationParams struct to group common parameters
- Refactor all VPC Peering, PSC, and TGW functions to use the new struct
- Update all function call sites to use the parameter struct
- Remove unused AsyncOperationArgs imports
- Reduces function parameters from 8-10 down to 2-4 arguments
@joshrotenberg joshrotenberg merged commit eb6d49f into main Sep 7, 2025
9 checks passed
@joshrotenberg joshrotenberg deleted the feat/connectivity-wait-flag branch September 7, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(cloud): add --wait flag to connectivity commands

2 participants