@@ -7004,12 +7004,13 @@ def __init__(self):
70047004 self .repo_pause_cmd = BackupServiceRepoPause (self .subparser )
70057005 self .repo_resume_cmd = BackupServiceRepoResume (self .subparser )
70067006 self .repo_worm_cmd = BackupServiceRepoWORM (self .subparser )
7007+ self .repo_cloud_config_cmd = BackupServiceRepoCloudConfig (self .subparser )
70077008 self .plan_cmd = BackupServicePlan (self .subparser )
70087009 self .nodeThreads_cmd = BackupServiceNodeThreadsMap (self .subparser )
70097010
70107011 def execute (self , opts ):
70117012 subcommands = ['settings' , 'repository' , 'repo-list' , 'repo-get' , 'repo-add' , 'repo-archive' , 'repo-remove' ,
7012- 'repo-pause' , 'repo-resume' , 'repo-worm' , 'plan' , 'node-threads' ]
7013+ 'repo-pause' , 'repo-resume' , 'repo-worm' , 'repo-cloud-config' , ' plan' , 'node-threads' ]
70137014
70147015 if opts .sub_cmd is None or opts .sub_cmd not in subcommands :
70157016 _exit_if_errors ([f'<subcommand> must be one of { subcommands } ' ])
@@ -7034,6 +7035,8 @@ def execute(self, opts):
70347035 self .repo_resume_cmd .execute (opts )
70357036 elif opts .sub_cmd == 'repo-worm' :
70367037 self .repo_worm_cmd .execute (opts )
7038+ elif opts .sub_cmd == 'repo-cloud-config' :
7039+ self .repo_cloud_config_cmd .execute (opts )
70377040 elif opts .sub_cmd == 'plan' :
70387041 self .plan_cmd .execute (opts )
70397042 elif opts .sub_cmd == 'node-threads' :
@@ -7579,6 +7582,48 @@ def get_description():
75797582 return 'Set WORM for a repository'
75807583
75817584
7585+ class BackupServiceRepoCloudConfig :
7586+ """Modify the cloud config for a repository.
7587+ """
7588+
7589+ def __init__ (self , subparser ):
7590+ """setup the parser"""
7591+ self .rest = None
7592+ repository_parser = subparser .add_parser ('repo-cloud-config' , help = 'Modify the cloud config for a repository' ,
7593+ add_help = False , allow_abbrev = False )
7594+
7595+ repository_parser .add_argument ('--id' , metavar = '<id>' , help = 'The repository id' , required = True )
7596+
7597+ cloud_group = repository_parser .add_argument_group ('Backup repository cloud arguments' )
7598+ cloud_group .add_argument ('--retention-delete-versions' , metavar = "<0|1>" , choices = ["0" , "1" ],
7599+ help = 'Enable or disable deleting old object versions when pruning backups with '
7600+ 'expired retention period' )
7601+
7602+ @rest_initialiser (version_check = True , enterprise_check = True , cluster_init_check = True )
7603+ def execute (self , opts ):
7604+ """Run the backup-service repo-cloud-config subcommand"""
7605+
7606+ body = {}
7607+
7608+ if opts .retention_delete_versions is not None :
7609+ body ["retention_delete_versions" ] = opts .retention_delete_versions == "1"
7610+
7611+ if body == {}:
7612+ _exit_if_errors (['At least one cloud argument is required' ])
7613+
7614+ _ , errors = self .rest .modify_repository_cloud_config (opts .id , body )
7615+ _exit_if_errors (errors )
7616+ _success ('Repository cloud config was modified successfully' )
7617+
7618+ @staticmethod
7619+ def get_man_page_name ():
7620+ return get_doc_page_name ("couchbase-cli-backup-service-repo-cloud-config" )
7621+
7622+ @staticmethod
7623+ def get_description ():
7624+ return 'Modify the cloud config for a repository'
7625+
7626+
75827627class BackupServiceRepository :
75837628 """(Deprecated) This command manages backup services repositories.
75847629
0 commit comments