Interface BackupRestoreProvider


public interface BackupRestoreProvider
Provides a standard set of methods for Backup Restore Providers.
Since:
0.13.4
  • Method Details

    • configureRestoreBackup

      ServiceResponse configureRestoreBackup(BackupResult backupResultModel, Map config, Map opts)
      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 restored
      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 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 restored
      instanceModel - 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

      ServiceResponse validateRestoreBackup(BackupResult backupResultModel, Map opts)
      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 restored
      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.
    • getRestoreOptions

      ServiceResponse getRestoreOptions(Backup backupModel, Map opts)
      Get restore options to configure the restore wizard. Although the BackupProvider and BackupTypeProvider 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 backup
      opts - 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 executed
      backupResultModel - refernce to the backup result
      backupModel - reference to the backup associated with the backup result
      opts - 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 restore
      backupResult - 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.