Interface BackupTypeProvider

All Superinterfaces:
PluginProvider
All Known Implementing Classes:
AbstractBackupTypeProvider, AbstractMorpheusBackupTypeProvider

public interface BackupTypeProvider extends PluginProvider
Provider associated with a specific BackupType. Backup Types handle the differences in cloud providers. For example the backup process for VMware and AWS are very different. These differences may be abstracted out by the external backup provider, but often the provider has separate endpoints for each cloud provider type. Backup Types provide the flexibility to handle the differences in clouds within a single backup provider.
Since:
0.13.4
  • Method Details

    • getContainerType

      String getContainerType()
      get the type of container compatible with this backup type
      Returns:
      the container type code
    • getCopyToStore

      Boolean getCopyToStore()
      Determines if this backup type supports copying the backup to a datastore (export).
      Returns:
      boolean indicating copy to store is supported
    • getDownloadEnabled

      Boolean getDownloadEnabled()
      Determines if this backup type supports downloading the backups for this backup type.
      Returns:
      boolean indicating downloading is enabled
    • getRestoreExistingEnabled

      Boolean getRestoreExistingEnabled()
      Determines if this backup type supports restoring a backup to the existing workload.
      Returns:
      boolean indicating restore to existing is enabled
    • getRestoreNewEnabled

      Boolean getRestoreNewEnabled()
      Determines if this backup type supports restoring to a new workload rather than replacing the existing workload.
      Returns:
      boolean indicating restore to new is enabled
    • getRestoreType

      String getRestoreType()
      Indicates the type of restore supported. Current options include: new, existing, online, offline, migration, failover
      Returns:
      the supported restore type
    • getRestoreNewMode

      String getRestoreNewMode()
      Get the desired method of restoring a backup to a new instance.

      Available options:

      • DEFAULT -- Uses the backup as an input to the instance provision process. Generally this involves using a snapshot or image ID as the image used for provisioning, but the precise details are left up to the backup provider.
      • VM_RESTORE -- The external backup provider restores to a VM and the core system will associate the resulting VM to the internal resources.
      • TEMP_EXTRACT -- determines the visibility of the restore to new option
      Returns:
    • getHasCopyToStore

      Boolean getHasCopyToStore()
      Does this backup type provider support copy to store?
      Returns:
      boolean indicating copy to store support
    • getOptionTypes

      Collection<OptionType> getOptionTypes()
      A list of OptionTypes for use in the backup create and edit forms.
      Returns:
      a list of option types
    • refresh

      ServiceResponse refresh(Map authConfig, BackupProvider backupProvider)
      Refresh the provider with the associated data in the external system.
      Parameters:
      authConfig - necessary connection and credentials to connect to the external provider
      backupProvider - an instance of the backup integration provider
      Returns:
      a ServiceResponse object. A ServiceResponse with a success value of 'false' will indicate the refresh process has failed and will halt any further backup creation processes in the core system.
    • clean

      ServiceResponse clean(BackupProvider backupProvider, Map opts)
      Clean up all data created by the backup type provider.
      Parameters:
      backupProvider - the provider to be cleaned up
      opts - additional options
      Returns:
      a ServiceResponse object
    • configureBackup

      ServiceResponse configureBackup(Backup backup, 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:
      backup - 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 backup, 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:
      backup - 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 backup, Map opts)
      Create the backup resources on the external provider system.
      Parameters:
      backup - 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 backup, Map opts)
      Delete the backup resources on the external provider system.
      Parameters:
      backup - 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 backupResult, Map opts)
      Delete the results of a backup execution on the external provider system.
      Parameters:
      backupResult - the backup result 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 backup, Map opts)
      A hook into the execution process. This method is called before the backup execution occurs.
      Parameters:
      backup - 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 backupResult, 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:
      backupResult - the backup result details
      opts - additional options used during the backup execution process
      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 backupResult, Map opts)
      Cancel the backup execution process without waiting for a result.
      Parameters:
      backupResult - 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 backupResult, 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:
      backupResult - 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.
    • configureRestoreBackup

      ServiceResponse configureRestoreBackup(BackupResult backupResult, 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:
      backupResult - 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 backupResult, Instance instance, Map restoreConfig, Map opts)
      Build the configuration for the restored instance.
      Parameters:
      backupResult - backup result to be restored
      instance - 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 backupResult, 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:
      backupResult - 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 backup, 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:
      backup - 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 backupRestore, BackupResult backupResult, Backup backup, Map opts)
      Execute the backup restore on the external system
      Parameters:
      backupRestore - restore to be executed
      backupResult - refernce to the backup result
      backup - 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.