File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -827,6 +827,28 @@ def launchBackupPipeline(dynClient: DynamicClient, params: dict) -> str:
827827 pipelineURL = f"{ getConsoleURL (dynClient )} /k8s/ns/mas-{ instanceId } -pipelines/tekton.dev~v1beta1~PipelineRun/{ instanceId } -backup-{ backupVersion } "
828828 return pipelineURL
829829
830+ def launchRestorePipeline (dynClient : DynamicClient , params : dict ) -> str :
831+ """
832+ Create a PipelineRun to restore a MAS instance.
833+
834+ Parameters:
835+ dynClient (DynamicClient): OpenShift Dynamic Client
836+ params (dict): Backup/Restore parameters including instance ID and configuration
837+
838+ Returns:
839+ str: URL to the PipelineRun in the OpenShift console
840+
841+ Raises:
842+ NotFoundError: If resources cannot be created
843+ """
844+ instanceId = params ["mas_instance_id" ]
845+ restoreVersion = params ["restore_version" ]
846+ namespace = f"mas-{ instanceId } -pipelines"
847+ launchPipelineRun (dynClient , namespace , "pipelinerun-restore" , params )
848+
849+ pipelineURL = f"{ getConsoleURL (dynClient )} /k8s/ns/mas-{ instanceId } -pipelines/tekton.dev~v1beta1~PipelineRun/{ instanceId } -restore-{ restoreVersion } "
850+ return pipelineURL
851+
830852
831853def launchAiServiceUpgradePipeline (dynClient : DynamicClient ,
832854 aiserviceInstanceId : str ,
You can’t perform that action at this time.
0 commit comments