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 a backup creation and execution.
- Since:
- 0.12.2
-
Method Summary
Modifier and TypeMethodDescriptioncancelBackup
(BackupResult backupResultModel, Map opts) Cancel the backup execution process without waiting for a result.configureBackup
(Backup backupModel, Map config, Map opts) Add additional configurations to a backup.createBackup
(Backup backupModel, Map opts) Create the backup resources on the external provider system.deleteBackup
(Backup backupModel, Map opts) Delete the backup resources on the external provider system.deleteBackupResult
(BackupResult backupResultModel, Map opts) Delete the results of a backup execution on the external provider system.executeBackup
(Backup backup, BackupResult backupResult, Map executionConfig, Cloud cloud, ComputeServer computeServer, Map opts) Initiate the backup process on the external provider system.extractBackup
(BackupResult backupResultModel, Map opts) Extract the results of a backup.prepareBackupResult
(BackupResult backupResultModel, Map opts) Provide additional configuration on the backup result.prepareExecuteBackup
(Backup backupModel, Map opts) A hook into the execution process.refreshBackupResult
(BackupResult backupResult) Periodically call until the backup execution has successfully completed.validateBackup
(Backup backupModel, Map config, Map opts) Validate the configuration of the backup.
-
Method Details
-
configureBackup
Add additional configurations to a backup. Morpheus will handle all basic configuration details, this is a convenient 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
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
Create the backup resources on the external provider system.- Parameters:
backupModel
- the fully configured and validated backup. The backupModel has not been persisted at this point and does not have an ID to save changes via the plugin API. Modify the backupModel and send it back to morpheus on the response data attributed.opts
- 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. Return the backupModel on the ServiceResponse.data attribute to persist changes to the backup object.
-
deleteBackup
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
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
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
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:
- a
ServiceResponse
indicating the success or failure of the method. A success value of 'false' will halt the further execution process.
-
executeBackup
ServiceResponse<BackupExecutionResponse> executeBackup(Backup backup, BackupResult backupResult, Map executionConfig, Cloud cloud, ComputeServer computeServer, 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
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:
- a
ServiceResponse
indicating the success or failure of the method. A success value of 'false' will halt the further execution process.n
-
cancelBackup
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
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.
-