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 Details

    • configureBackup

      ServiceResponse configureBackup(Backup backupModel, Map config, Map opts)
      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

      ServiceResponse validateBackup(Backup backupModel, Map config, 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 validate
      config - 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 of errors['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, Map opts)
      Create the backup resources on the external provider system.
      Parameters:
      backupModel - the fully configured and validated backup
      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.
    • deleteBackup

      ServiceResponse deleteBackup(Backup backupModel, Map opts)
      Delete the backup resources on the external provider system.
      Parameters:
      backupModel - the backup details
      opts - 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, Map opts)
      Delete the results of a backup execution on the external provider system.
      Parameters:
      backupResultModel - the backup results details
      opts - 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, 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 execution
      opts - 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, 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:
      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 execution
      computeServer - the target of the backup execution
      opts - 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<BackupExecutionResponse> 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 the BackupStatusUtility 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

      ServiceResponse cancelBackup(BackupResult backupResultModel, 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, 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.