Package com.morpheusdata.core.backup
Interface BackupExecutionProvider
-
public interface BackupExecutionProvider
Provides an interface for defining a backup execution provider. A backup execution provider handles all operations related to backup creation and execution.- Since:
- 0.12.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ServiceResponse
cancelBackup(BackupResult backupResultModel, java.util.Map opts)
Cancel the backup execution process without waiting for a result.ServiceResponse
configureBackup(Backup backupModel, java.util.Map config, java.util.Map opts)
Add additional configurations to a backup.ServiceResponse
createBackup(Backup backupModel, java.util.Map opts)
Create the backup resources on the external provider system.ServiceResponse
deleteBackup(Backup backupModel, java.util.Map opts)
Delete the backup resources on the external provider system.ServiceResponse
deleteBackupResult(BackupResult backupResultModel, java.util.Map opts)
Delete the results of a backup execution on the external provider system.ServiceResponse
executeBackup(Backup backup, BackupResult backupResult, java.util.Map executionConfig, Cloud cloud, ComputeServer computeServer, java.util.Map opts)
Initiate the backup process on the external provider system.ServiceResponse
extractBackup(BackupResult backupResultModel, java.util.Map opts)
Extract the results of a backup.ServiceResponse
prepareBackupResult(BackupResult backupResultModel, java.util.Map opts)
Provide additional configuration on the backup result.ServiceResponse
prepareExecuteBackup(Backup backupModel, java.util.Map opts)
A hook into the execution process.ServiceResponse
refreshBackupResult(BackupResult backupResult)
Periodically call until the backup execution has successfully completed.ServiceResponse
validateBackup(Backup backupModel, java.util.Map config, java.util.Map opts)
Validate the configuration of the backup.
-
-
-
Method Detail
-
configureBackup
ServiceResponse configureBackup(Backup backupModel, java.util.Map config, java.util.Map opts)
Add additional configurations to a backup. Morpheus will handle all basic configuration details, this is a convient way to add additional configuration details specific to this backup provider.- Parameters:
backupModel
- the current backup the configurations are applied to.config
- the configuration supplied by external inputs.opts
- optional parameters used for configuration.- Returns:
- a
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup creation process.
-
validateBackup
ServiceResponse validateBackup(Backup backupModel, java.util.Map config, java.util.Map opts)
Validate the configuration of the backup. Morpheus will validate the backup based on the supplied option type configurations such as required fields. Use this to either override the validation results supplied by the default validation or to create additional validations beyond the capabilities of option type validation.- Parameters:
backupModel
- the backup to validateconfig
- the original configuration supplied by external inputs.opts
- optional parameters used for- Returns:
- a
ServiceResponse
object. The errors field of the ServiceResponse is used to send validation results back to the interface in the format oferrors['fieldName'] = 'validation message'
. The msg property can be used to send generic validation text that is not related to a specific field on the model. A ServiceResponse with any items in the errors list or a success value of 'false' will halt the backup creation process.
-
createBackup
ServiceResponse createBackup(Backup backupModel, java.util.Map opts)
Create the backup resources on the external provider system.- Parameters:
backupModel
- the fully configured and validated backupopts
- additional options used during backup creation- Returns:
- a
ServiceResponse
object. A ServiceResponse with a success value of 'false' will indicate the creation on the external system failed and will halt any further backup creation processes in morpheus.
-
deleteBackup
ServiceResponse deleteBackup(Backup backupModel, java.util.Map opts)
Delete the backup resources on the external provider system.- Parameters:
backupModel
- the backup detailsopts
- additional options used during the backup deletion process- Returns:
- a
ServiceResponse
indicating the results of the deletion on the external provider system. A ServiceResponse object with a success value of 'false' will halt the deletion process and the local refernce will be retained.
-
deleteBackupResult
ServiceResponse deleteBackupResult(BackupResult backupResultModel, java.util.Map opts)
Delete the results of a backup execution on the external provider system.- Parameters:
backupResultModel
- the backup results detailsopts
- additional options used during the backup result deletion process- Returns:
- a
ServiceResponse
indicating the results of the deletion on the external provider system. A ServiceResponse object with a success value of 'false' will halt the deletion process and the local refernce will be retained.
-
prepareExecuteBackup
ServiceResponse prepareExecuteBackup(Backup backupModel, java.util.Map opts)
A hook into the execution process. This method is called before the backup execution occurs.- Parameters:
backupModel
- the backup details associated with the backup executionopts
- additional options used during the backup execution process- Returns:
- a
ServiceResponse
indicating the success or failure of the execution preperation. A success value of 'false' will halt the execution process.
-
prepareBackupResult
ServiceResponse prepareBackupResult(BackupResult backupResultModel, java.util.Map opts)
Provide additional configuration on the backup result. The backup result is a representation of the output of the backup execution including the status and a reference to the output that can be used in any future operations.- Parameters:
backupResultModel
-opts
-- Returns:
-
executeBackup
ServiceResponse executeBackup(Backup backup, BackupResult backupResult, java.util.Map executionConfig, Cloud cloud, ComputeServer computeServer, java.util.Map opts)
Initiate the backup process on the external provider system.- Parameters:
backup
- the backup details associated with the backup execution.backupResult
- the details associated with the results of the backup execution.executionConfig
- original configuration supplied for the backup execution.cloud
- cloud context of the target of the backup executioncomputeServer
- the target of the backup executionopts
- additional options used during the backup execution process- Returns:
- a
ServiceResponse
indicating the success or failure of the backup execution. A success value of 'false' will halt the execution process.
-
refreshBackupResult
ServiceResponse refreshBackupResult(BackupResult backupResult)
Periodically call until the backup execution has successfully completed. The default refresh interval is 60 seconds.- Parameters:
backupResult
- the reference to the results of the backup execution including the last known status. Set the status to a canceled/succeeded/failed value from one of theBackupStatusUtility
values to end the execution process.- Returns:
-
cancelBackup
ServiceResponse cancelBackup(BackupResult backupResultModel, java.util.Map opts)
Cancel the backup execution process without waiting for a result.- Parameters:
backupResultModel
- the details associated with the results of the backup execution.opts
- additional options.- Returns:
- a
ServiceResponse
indicating the success or failure of the backup execution cancellation.
-
extractBackup
ServiceResponse extractBackup(BackupResult backupResultModel, java.util.Map opts)
Extract the results of a backup. This is generally used for packaging up a full backup for the purposes of a download or full archive of the backup.- Parameters:
backupResultModel
- the details associated with the results of the backup execution.opts
- additional options.- Returns:
- a
ServiceResponse
indicating the success or failure of the backup extraction.
-
-