Package com.morpheusdata.core.backup
Interface BackupRestoreProvider
public interface BackupRestoreProvider
Provides a standard set of methods for Backup Restore Providers.
- Since:
- 0.13.4
-
Method Summary
Modifier and TypeMethodDescriptionconfigureRestoreBackup
(BackupResult backupResultModel, Map config, Map opts) Add additional configurations to a backup restore.getBackupRestoreInstanceConfig
(BackupResult backupResultModel, Instance instanceModel, Map restoreConfig, Map opts) Build the configuration for the restored instance.getRestoreOptions
(Backup backupModel, Map opts) Get restore options to configure the restore wizard.refreshBackupRestoreResult
(BackupRestore backupRestore, BackupResult backupResult) Periodically check for any updates to an in-progress restore.restoreBackup
(BackupRestore backupRestoreModel, BackupResult backupResultModel, Backup backupModel, Map opts) Execute the backup restore on the external systemvalidateRestoreBackup
(BackupResult backupResultModel, Map opts) Verify the backup restore is valid.
-
Method Details
-
configureRestoreBackup
Add additional configurations to a backup restore. Morpheus will handle all basic configuration details, this is a convenient way to add additional configuration details specific to this backup restore provider.- Parameters:
backupResultModel
- backup result to be restoredconfig
- the configuration supplied by external inputsopts
- 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 restore process.
-
getBackupRestoreInstanceConfig
ServiceResponse getBackupRestoreInstanceConfig(BackupResult backupResultModel, Instance instanceModel, Map restoreConfig, Map opts) Build the configuration for the restored instance.- Parameters:
backupResultModel
- backup result to be restoredinstanceModel
- the instance the backup was created from, if it still exists. Retained backups will not have a reference to the instance.restoreConfig
- the restore configuration generated by morpheus.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 restore process.
-
validateRestoreBackup
Verify the backup restore is valid. Generally used to check if the backup and instance are both in a state compatible for executing the restore process.- Parameters:
backupResultModel
- backup result to be restoredopts
- 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 restore process.
-
getRestoreOptions
Get restore options to configure the restore wizard. Although theBackupProvider
andBackupTypeProvider
supply configuration, there may be situations where the instance configuration will determine which options need to be presented in the restore wizard.Available Restore options:
- restoreExistingEnabled (Boolean) -- determines the visibility of the restore to existing option
- restoreNewEnabled (Boolean) -- determines the visibility of the restore to new option
- name (String) -- default name of the restored instance
- hostname (String) -- default hostname of the restored instance
- Parameters:
backupModel
- the backupopts
- optional parameters- Returns:
- a
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
restoreBackup
ServiceResponse<BackupRestoreResponse> restoreBackup(BackupRestore backupRestoreModel, BackupResult backupResultModel, Backup backupModel, Map opts) Execute the backup restore on the external system- Parameters:
backupRestoreModel
- restore to be executedbackupResultModel
- refernce to the backup resultbackupModel
- reference to the backup associated with the backup resultopts
- optional parameters- Returns:
- a
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
refreshBackupRestoreResult
ServiceResponse<BackupRestoreResponse> refreshBackupRestoreResult(BackupRestore backupRestore, BackupResult backupResult) Periodically check for any updates to an in-progress restore. This method will be executed every 60 seconds for the restore while the restore has a status of `START_REQUESTED` or `IN_PROGRESS`. Any other status will indicate the restore has completed and does not need to be refreshed. The primary use case for this method is long-running restores to avoid consuming resources during the restore process.- Parameters:
backupRestore
- the running restorebackupResult
- backup result referencing the backup to be restored- Returns:
- a
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-