Package com.morpheusdata.core.backup
Class AbstractBackupTypeProvider
java.lang.Object
com.morpheusdata.core.backup.AbstractBackupTypeProvider
- All Implemented Interfaces:
BackupTypeProvider,PluginProvider
Provides a standard set of methods for a
BackupProvider. A backup provider is the primary connection to the
external provider services. The backup provider supplies providers for provision types and/or container types via
the BackupTypeProviders implemented within the provider.- Since:
- 0.13.4
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.morpheusdata.core.providers.PluginProvider
PluginProvider.EventSubscriberFacet<E extends Event> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncancelBackup(BackupResult backupResultModel, Map opts) Cancel the backup execution process without waiting for a result.clean(BackupProvider backupProviderModel, Map opts) Clean up all data created by the backup type provider.configureBackup(Backup backupModel, Map config, Map opts) Add additional configurations to a backup.configureRestoreBackup(BackupResult backupResultModel, Map config, Map opts) Add additional configurations to a backup restore.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 backupModel, 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.getBackupRestoreInstanceConfig(BackupResult backupResultModel, Instance instanceModel, Map restoreConfig, Map opts) Build the configuration for the restored instance.abstract BackupExecutionProviderGet the backup provider which will be responsible for all the operations related to backup executions.Returns the Morpheus Context for interacting with data stored in the Main Morpheus ApplicationReturns the instance of the Plugin class that this provider is loaded fromgetRestoreOptions(Backup backupModel, Map opts) Get restore options to configure the restore wizard.abstract BackupRestoreProviderGet the backup provider which will be responsible for all the operations related to backup restore.prepareBackupResult(BackupResult backupResultModel, Map opts) Provide additional configuration on the backup result.prepareExecuteBackup(Backup backupModel, Map opts) A hook into the execution process.refresh(Map authConfig, BackupProvider backupProvider) Refresh the provider with the associated data in the external system.refreshBackupRestoreResult(BackupRestore backupRestoreModel, BackupResult backupResultModel) Periodically check for any updates to an in-progress restore.refreshBackupResult(BackupResult backupResult) Periodically call until the backup execution has successfully completed.restoreBackup(BackupRestore backupRestore, BackupResult backupResultModel, Backup backupModel, Map opts) Execute the backup restore on the external systemvoidsetExecutionProvider(BackupExecutionProvider executionProvider) Set the backup provider which will be responsible for all the operations related to backup executions.voidsetRestoreProvider(BackupRestoreProvider restoreProvider) Get the backup provider which will be responsible for all the operations related to backup restore.validateBackup(Backup backupModel, Map config, Map opts) Validate the configuration of the backup.validateRestoreBackup(BackupResult backupResultModel, Map opts) Verify the backup restore is valid.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.morpheusdata.core.backup.BackupTypeProvider
getContainerType, getCopyToStore, getDownloadEnabled, getHasCopyToStore, getOptionTypes, getRestoreExistingEnabled, getRestoreExistingOptionTypes, getRestoreNewEnabled, getRestoreNewMode, getRestoreNewOptionTypes, getRestoreType, isSnapshotMethods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getName, isPlugin
-
Constructor Details
-
AbstractBackupTypeProvider
-
-
Method Details
-
getMorpheus
Description copied from interface:PluginProviderReturns the Morpheus Context for interacting with data stored in the Main Morpheus Application- Specified by:
getMorpheusin interfacePluginProvider- Returns:
- an implementation of the MorpheusContext for running Future based rxJava queries
-
getPlugin
Description copied from interface:PluginProviderReturns the instance of the Plugin class that this provider is loaded from- Specified by:
getPluginin interfacePluginProvider- Returns:
- Plugin class contains references to other providers
-
getExecutionProvider
Get the backup provider which will be responsible for all the operations related to backup executions.- Returns:
- a
BackupExecutionProviderproviding methods for backup execution.
-
setExecutionProvider
Set the backup provider which will be responsible for all the operations related to backup executions.- Parameters:
executionProvider- aBackupExecutionProviderproviding methods for backup execution.
-
getRestoreProvider
Get the backup provider which will be responsible for all the operations related to backup restore.- Returns:
- a
BackupRestoreProviderproviding methods for backup restore operations.
-
setRestoreProvider
Get the backup provider which will be responsible for all the operations related to backup restore.- Parameters:
restoreProvider- aBackupRestoreProviderproviding methods for backup restore operations.
-
refresh
Description copied from interface:BackupTypeProviderRefresh the provider with the associated data in the external system.- Specified by:
refreshin interfaceBackupTypeProvider- Parameters:
authConfig- necessary connection and credentials to connect to the external providerbackupProvider- an instance of the backup integration provider- Returns:
- a
ServiceResponseobject. 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
Description copied from interface:BackupTypeProviderClean up all data created by the backup type provider.- Specified by:
cleanin interfaceBackupTypeProvider- Parameters:
backupProviderModel- the provider to be cleaned upopts- additional options- Returns:
- a
ServiceResponseobject
-
configureBackup
Description copied from interface:BackupTypeProviderAdd 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.- Specified by:
configureBackupin interfaceBackupTypeProvider- 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
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup creation process.
-
validateBackup
Description copied from interface:BackupTypeProviderValidate 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.- Specified by:
validateBackupin interfaceBackupTypeProvider- Parameters:
backupModel- the backup to validateconfig- the original configuration supplied by external inputs.opts- optional parameters used for- Returns:
- a
ServiceResponseobject. 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
Description copied from interface:BackupTypeProviderCreate the backup resources on the external provider system.- Specified by:
createBackupin interfaceBackupTypeProvider- Parameters:
backupModel- the fully configured and validated backupopts- additional options used during backup creation- Returns:
- a
ServiceResponseobject. 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
Description copied from interface:BackupTypeProviderDelete the backup resources on the external provider system.- Specified by:
deleteBackupin interfaceBackupTypeProvider- Parameters:
backupModel- the backup detailsopts- additional options used during the backup deletion process- Returns:
- a
ServiceResponseindicating 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
Description copied from interface:BackupTypeProviderDelete the results of a backup execution on the external provider system.- Specified by:
deleteBackupResultin interfaceBackupTypeProvider- Parameters:
backupResultModel- the backup result detailsopts- additional options used during the backup result deletion process- Returns:
- a
ServiceResponseindicating 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
Description copied from interface:BackupTypeProviderA hook into the execution process. This method is called before the backup execution occurs.- Specified by:
prepareExecuteBackupin interfaceBackupTypeProvider- Parameters:
backupModel- the backup details associated with the backup executionopts- additional options used during the backup execution process- Returns:
- a
ServiceResponseindicating the success or failure of the execution preperation. A success value of 'false' will halt the execution process.
-
prepareBackupResult
Description copied from interface:BackupTypeProviderProvide 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.- Specified by:
prepareBackupResultin interfaceBackupTypeProvider- Parameters:
backupResultModel- the backup result detailsopts- additional options used during the backup execution process- Returns:
- a
ServiceResponseindicating the success or failure of the method. A success value of 'false' will halt the further execution process.
-
executeBackup
public ServiceResponse<BackupExecutionResponse> executeBackup(Backup backupModel, BackupResult backupResult, Map executionConfig, Cloud cloud, ComputeServer computeServer, Map opts) Description copied from interface:BackupTypeProviderInitiate the backup process on the external provider system.- Specified by:
executeBackupin interfaceBackupTypeProvider- Parameters:
backupModel- 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
ServiceResponseindicating the success or failure of the backup execution. A success value of 'false' will halt the execution process.
-
refreshBackupResult
Description copied from interface:BackupTypeProviderPeriodically call until the backup execution has successfully completed. The default refresh interval is 60 seconds.- Specified by:
refreshBackupResultin interfaceBackupTypeProvider- 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 theBackupStatusUtilityvalues to end the execution process.- Returns:
- a
ServiceResponseindicating the success or failure of the method. A success value of 'false' will halt the further execution process.n
-
cancelBackup
Description copied from interface:BackupTypeProviderCancel the backup execution process without waiting for a result.- Specified by:
cancelBackupin interfaceBackupTypeProvider- Parameters:
backupResultModel- the details associated with the results of the backup execution.opts- additional options.- Returns:
- a
ServiceResponseindicating the success or failure of the backup execution cancellation.
-
extractBackup
Description copied from interface:BackupTypeProviderExtract 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.- Specified by:
extractBackupin interfaceBackupTypeProvider- Parameters:
backupResultModel- the details associated with the results of the backup execution.opts- additional options.- Returns:
- a
ServiceResponseindicating the success or failure of the backup extraction.
-
configureRestoreBackup
Description copied from interface:BackupTypeProviderAdd 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.- Specified by:
configureRestoreBackupin interfaceBackupTypeProvider- Parameters:
backupResultModel- backup result to be restoredconfig- the configuration supplied by external inputsopts- optional parameters used for configuration.- Returns:
- a
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
getBackupRestoreInstanceConfig
public ServiceResponse getBackupRestoreInstanceConfig(BackupResult backupResultModel, Instance instanceModel, Map restoreConfig, Map opts) Description copied from interface:BackupTypeProviderBuild the configuration for the restored instance.- Specified by:
getBackupRestoreInstanceConfigin interfaceBackupTypeProvider- 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
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
validateRestoreBackup
Description copied from interface:BackupTypeProviderVerify 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.- Specified by:
validateRestoreBackupin interfaceBackupTypeProvider- Parameters:
backupResultModel- backup result to be restoredopts- optional parameters used for configuration.- Returns:
- a
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
getRestoreOptions
Description copied from interface:BackupTypeProviderGet restore options to configure the restore wizard. Although theBackupProviderandBackupTypeProvidersupply 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
- Specified by:
getRestoreOptionsin interfaceBackupTypeProvider- Parameters:
backupModel- the backupopts- optional parameters- Returns:
- a
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
restoreBackup
public ServiceResponse<BackupRestoreResponse> restoreBackup(BackupRestore backupRestore, BackupResult backupResultModel, Backup backupModel, Map opts) Description copied from interface:BackupTypeProviderExecute the backup restore on the external system- Specified by:
restoreBackupin interfaceBackupTypeProvider- Parameters:
backupRestore- restore to be executedbackupResultModel- refernce to the backup resultbackupModel- reference to the backup associated with the backup resultopts- optional parameters- Returns:
- a
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
refreshBackupRestoreResult
public ServiceResponse<BackupRestoreResponse> refreshBackupRestoreResult(BackupRestore backupRestoreModel, BackupResult backupResultModel) Description copied from interface:BackupTypeProviderPeriodically 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.- Specified by:
refreshBackupRestoreResultin interfaceBackupTypeProvider- Parameters:
backupRestoreModel- the running restorebackupResultModel- backup result referencing the backup to be restored- Returns:
- a
ServiceResponseobject. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-