Skip to content

[CLOUDGA-26749] [CLOUDGA-26752] [CLOUDGA-26753] Enable/Update/Disable GCP Backup Replication - #319

Merged
pranbansal02 merged 2 commits into
mainfrom
pranav/CLOUDGA-26749
Nov 28, 2025
Merged

[CLOUDGA-26749] [CLOUDGA-26752] [CLOUDGA-26753] Enable/Update/Disable GCP Backup Replication#319
pranbansal02 merged 2 commits into
mainfrom
pranav/CLOUDGA-26749

Conversation

@pranbansal02

@pranbansal02 pranbansal02 commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Overview

This PR adds CLI commands for enabling and updating GCP backup replication configuration.

  • Added Unit tests for the enable command
  • Added documentation for all commands
  • Feature Flag: Command is gated behind YBM_FF_BACKUP_REPLICATION_GCP_TARGET feature flag

Commands Added

1. Action Command: enable

Command: ybm cluster backup-replication gcp enable

Help Output:

Enable GCP backup replication for all backup regions in the cluster

Usage:
  ybm cluster backup-replication gcp enable [flags]

Flags:
  -h, --help                        help for enable
      --region-target stringArray   [REQUIRED] Specify region and bucket pairs for backup replication. Format: region=<region-name>,bucket-name=<bucket-name>. Must be specified for each backup region in the cluster.

Global Flags:
  -c, --cluster-name string   [REQUIRED] The name of the cluster.
  -o, --output string         Select the desired output format (table, json, pretty). Default to table
      --wait                  Wait until the task is completed, otherwise it will exit immediately, default to false

Usage Example:

$ ./ybm cluster backup-replication gcp enable \
  --cluster-name gp-vpc \
  --region-target region=asia-southeast1,bucket-name=backup-bucket-1 \
  --region-target region=asia-south1,bucket-name=backup-bucket-2

Output (without --wait):

GCP backup replication for cluster gp-vpc is being enabled

Overall State: ENABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 ENABLED        backup-bucket-1          SUCCESS                   2024-01-15,09:30   2024-01-15,10:00
asia-south1     ENABLED        backup-bucket-2          IN_PROGRESS               N/A                2024-01-15,11:00

Output (with --wait):

GCP backup replication for cluster gp-vpc is being enabled: SUCCEEDED

GCP backup replication has been enabled for cluster gp-vpc

Overall State: ENABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 ENABLED        backup-bucket-1          SUCCESS                   2024-01-15,09:30   2024-01-15,10:00
asia-south1     ENABLED        backup-bucket-2          IN_PROGRESS               N/A                2024-01-15,11:00

2. Action Command: update

Command: ybm cluster backup-replication gcp update

Help Output:

Update GCP backup replication configuration for all backup regions in the cluster

Usage:
  ybm cluster backup-replication gcp update [flags]

Flags:
  -h, --help                        help for update
      --region-target stringArray   [REQUIRED] Specify region and bucket pairs for backup replication. Format: region=<region-name>,bucket-name=<bucket-name>. Must be specified for each backup region in the cluster.

Global Flags:
  -c, --cluster-name string   [REQUIRED] The name of the cluster.
  -o, --output string         Select the desired output format (table, json, pretty). Default to table
      --wait                  Wait until the task is completed, otherwise it will exit immediately, default to false

Usage Example:

$ ./ybm cluster backup-replication gcp update \
  --cluster-name gp-vpc \
  --region-target region=asia-southeast1,bucket-name=new-backup-bucket-1 \
  --region-target region=asia-south1,bucket-name=new-backup-bucket-2

Output (without --wait):

GCP backup replication for cluster gp-vpc is being updated

Overall State: ENABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 ENABLED        new-backup-bucket-1       SUCCESS                   2024-01-15,09:30   2024-01-15,10:00
asia-south1     ENABLED        new-backup-bucket-2      IN_PROGRESS               N/A                2024-01-15,11:00

Output (with --wait):

GCP backup replication for cluster gp-vpc is being updated: SUCCEEDED

GCP backup replication has been updated for cluster gp-vpc

Overall State: ENABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 ENABLED        new-backup-bucket-1       SUCCESS                   2024-01-15,09:30   2024-01-15,10:00
asia-south1     ENABLED        new-backup-bucket-2       IN_PROGRESS               N/A                2024-01-15,11:00

Validation for enable and update:

  • Requires --region-target for each backup region in the cluster
  • Validates region format: region=<region-name>,bucket-name=<bucket-name>
  • Validates that all specified regions are backup regions of the cluster
  • Validates no duplicate regions are provided
  • Validates that all backup regions have corresponding --region-target entries

3. Action Command: disable

Command: ybm cluster backup-replication gcp disable

Help Output:

Disable GCP backup replication for all backup regions in the cluster

Usage:
  ybm cluster backup-replication gcp disable [flags]

Flags:
  -f, --force   Bypass the confirmation prompt for non-interactive usage
  -h, --help    help for disable

Global Flags:
  -c, --cluster-name string   [REQUIRED] The name of the cluster.
  -o, --output string         Select the desired output format (table, json, pretty). Default to table
      --wait                  Wait until the task is completed, otherwise it will exit immediately, default to false

Usage Example:

$ ./ybm cluster backup-replication gcp disable \
  --cluster-name gp-vpc \
  --force

Output (without --wait):

GCP backup replication for cluster gp-vpc is being disabled

Overall State: DISABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 DISABLED        backup-bucket-1          SUCCESS                   2024-01-15,09:30   N/A
asia-south1     DISABLED        backup-bucket-2          IN_PROGRESS               N/A                N/A

Output (with --wait):

GCP backup replication for cluster gp-vpc is being disabled: SUCCEEDED

GCP backup replication has been disabled for cluster gp-vpc

Overall State: DISABLED
Region          Config State   Bucket Name              Latest Operation Status   Last Run           Next Run
asia-southeast1 DISABLED        backup-bucket-1          SUCCESS                   2024-01-15,09:30   N/A
asia-south1     DISABLED        backup-bucket-2          IN_PROGRESS               N/A                N/A

@pranbansal02
pranbansal02 requested a review from a team as a code owner November 26, 2025 03:39
@pranbansal02 pranbansal02 changed the title [CLOUDGA-26749] [CLOUDGA-26752] Enable and Update GCP Backup Replication [CLOUDGA-26749] [CLOUDGA-26752] [CLOUDGA-26753] Enable/Update/Disable GCP Backup Replication Nov 26, 2025

@posriniv posriniv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me. Let's wait for Siddharth's review too.

@pranbansal02
pranbansal02 merged commit cf1567e into main Nov 28, 2025
1 check passed
@pranbansal02
pranbansal02 deleted the pranav/CLOUDGA-26749 branch November 28, 2025 04:41
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.

3 participants