Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAT-15437][PLAT-15445][YBA CLI] Changes to backup restore set of co…
…mmands Summary: - Add KMS config UUID as an option for create restore - Add `parallelism` and `enableVerboseLogs`, `category` (to select between `yb_backup` and `ybc`) from `yb_backup.py` fields to create backup - Add `force` flag to list backup and restore to help in automation ``` ./yba backup create Create an universe backup in YugabyteDB Anywhere Usage: yba backup create [flags] Flags: --universe-name string [Required] Universe name. Name of the universe to be backed up --storage-config-name string [Required] Storage config to be used for taking the backup --table-type string [Required] Table type. Allowed values: ysql, ycql, yedis --time-before-delete-in-ms int [Optional] Retention time of the backup in milliseconds --keyspace-info stringArray [Optional] Keyspace info to perform backup operation.If no keyspace info is provided, then all the keyspaces of the table type specified are backed up. If the user wants to take backup of a subset of keyspaces, then the user has to specify the keyspace info. Provide the following semicolon separated fields as key value pairs, enclose the string with quotes: ""keyspace-name=<keyspace-name>;table-names=<table-name1>,<table-name2>,<table-name3>;table-ids=<table-id1>,<table-id2>,<table-id3>"". The table-names and table-ids attributes have to be specified as comma separated values. Keyspace name is required value. Table names and Table ids are optional values and are needed only for YCQL.Example: --keyspace-info "keyspace-name=cassandra;table-names=table1,table2;table-ids=1e683b86-7858-44d1-a1f6-406f50a4e56e,19a34a5e-3a19-4070-9d79-805ed713ce7d" --keyspace-info "keyspace-name=cassandra2;table-names=table3,table4;table-ids=e5b83a7c-130c-40c0-95ff-ec1d9ecff616,bc92d473-2e10-4f76-8bd1-9ca9741890fd" --use-tablespaces [Optional] Backup tablespaces information as part of the backup --sse [Optional] Enable sse while persisting the data in AWS S3 (default true) --category string [Optional] Category of the backup. Allowed values: YB_BACKUP_SCRIPT, YB_CONTROLLER --enable-verbose-logs [Optional] Enable verbose logging while taking backup via "yb_backup" script. (default false) --parallelism int [Optional] Number of concurrent commands to run on nodes over SSH via "yb_backup" script. (default 8) --base-backup-uuid string [Optional] Base Backup UUID for taking incremental backups -h, --help help for create Global Flags: -a, --apiToken string YugabyteDB Anywhere api token. --config string Config file, defaults to $HOME/.yba-cli.yaml --debug Use debug mode, same as --logLevel debug. --disable-color Disable colors in output. (default false) -H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000") -l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info") -o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table") --timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) --wait Wait until the task is completed, otherwise it will exit immediately. (default true) ``` ``` ./yba backup restore create Restore an universe backup in YugabyteDB Anywhere Usage: yba backup restore create [flags] Flags: --universe-name string [Required] Target universe name to perform restore operation. --storage-config-name string [Required] Storage config to be used for taking the backup --kms-config string [Optional] Key management service config name. For a successful restore, the KMS configuration used for restore should be the same KMS configuration used during backup creation. --keyspace-info stringArray [Required] Keyspace info to perform restore operation. Provide the following semicolon separated fields as key value pairs, and enclose the string with quotes: "'keyspace-name=<keyspace-name>;storage-location=<storage_location>;backup-type=<ycql/ysql>;use-tablespaces=<use-tablespaces>;selective-restore=<selective-restore>;table-name-list=<table-name1>,<table-name2>'". The table-name-list attribute has to be specified as comma separated values. Keyspace name, storage-location and backup-type are required values. The attribute use-tablespaces, selective-restore and table-name-list are optional values. Attributes selective-restore and table-name-list and are needed only for YCQL. The attribute use-tablespaces is to be used if needed only in the case of YSQL. Example: --keyspace-info 'keyspace-name=cassandra1;storage-location=s3://bucket/location1;backup-type=ycql;selective-restore=true;table-name-list=table1,table2' --keyspace-info 'keyspace-name=postgres;storage-location=s3://bucket/location2backup-type=ysql;use-tablespaces=true' -h, --help help for create Global Flags: -a, --apiToken string YugabyteDB Anywhere api token. --config string Config file, defaults to $HOME/.yba-cli.yaml --debug Use debug mode, same as --logLevel debug. --disable-color Disable colors in output. (default false) -H, --host string YugabyteDB Anywhere Host (default "http://localhost:9000") -l, --logLevel string Select the desired log level format. Allowed values: debug, info, warn, error, fatal. (default "info") -o, --output string Select the desired output format. Allowed values: table, json, pretty. (default "table") --timeout duration Wait command timeout, example: 5m, 1h. (default 168h0m0s) --wait Wait until the task is completed, otherwise it will exit immediately. (default true) ``` Test Plan: Manually test commands ``` ./yba backup create --universe-name dkumar-cli --storage-config-name dkumar-test-s3 --table-type ysql --time-before-delete-in-ms 3600000 --keyspace-info "keyspace-name=test1" --keyspace-info "keyspace-name=test2" --category YB_CONTROLLER ``` ``` ./yba backup restore create --universe-name dkumar-cli --storage-config-name dkumar-test-s3 --keyspace-info "keyspace-name=test11;storage-location=<>;backup-type=ysql" --keyspace-info "keyspace-name=test21;storage-location=<>;backup-type=ysql" ``` Reviewers: vpatibandla, sneelakantan Reviewed By: vpatibandla Subscribers: yugaware Differential Revision: https://phorge.dev.yugabyte.com/D38362
- Loading branch information