[CLOUDGA-31245] Add roles functionality to backup commands #322
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.
Overview
This PR contains the changes to support the new
use_rolesfield in backup, restore, and backup schedule APIs. This feature enables users to include global YSQL roles and permissions (grants) when creating backups and restore them when performing a restore operation.Changes
Apiserver has been enhanced with a new
use_rolesboolean field across:BackupSpec) - Include roles/grants when creating a backupRestoreSpec) - Restore roles/grants from a backupScheduleSpecV2) - Include roles/grants in scheduled backupsThe CLI changes add an
--include-rolesflag (gated behind a feature flag) to the relevant commands and display the roles inclusion status in list/describe outputs.Feature Flag
The
--include-rolesflag is controlled by a feature flag and is only available when enabled.Enabling the Feature
export YBM_FF_INCLUDE_ROLES_DURING_BACKUP_RESTORE=trueFeature Flag Definition
INCLUDE_ROLES_DURING_BACKUP_RESTOREYBM_FF_INCLUDE_ROLES_DURING_BACKUP_RESTORECommands Modified
1.
ybm backup createCreates a backup for a cluster with optional roles/grants inclusion.
Help Output
Example Usage
2.
ybm backup restoreRestores a backup into a cluster with optional roles/grants restoration.
Help Output
Example Usage
Important Note
The
--include-rolesflag on restore can only be used if the original backup was taken withuse_roles=true. The API will return an error if you try to restore roles from a backup that doesn't contain them.3.
ybm backup policy enableEnables a backup policy for a cluster with optional roles/grants inclusion.
Help Output
Example Usage
4.
ybm backup policy updateUpdates a backup policy for a cluster with optional roles/grants inclusion.
Help Output
Example Usage
5.
ybm backup listLists backups with a new "Roles & Grants" column showing inclusion status.
Example Output
Column Meanings
6.
ybm backup describeDescribes a backup with roles/grants inclusion status in the detailed view.
Example Output
7.
ybm backup policy listLists backup policies with a new "Include Roles & Grants" column.
Example Output
Column Meanings