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
-
Constructor Summary
-
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 BackupExecutionProvider
Get 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 BackupRestoreProvider
Get 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 systemvoid
setExecutionProvider
(BackupExecutionProvider executionProvider) Set the backup provider which will be responsible for all the operations related to backup executions.void
setRestoreProvider
(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, wait
Methods inherited from interface com.morpheusdata.core.backup.BackupTypeProvider
getContainerType, getCopyToStore, getDownloadEnabled, getHasCopyToStore, getOptionTypes, getRestoreExistingEnabled, getRestoreNewEnabled, getRestoreNewMode, getRestoreType
Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getName, isPlugin
-
Constructor Details
-
AbstractBackupTypeProvider
-
-
Method Details
-
getMorpheus
Description copied from interface:PluginProvider
Returns the Morpheus Context for interacting with data stored in the Main Morpheus Application- Specified by:
getMorpheus
in interfacePluginProvider
- Returns:
- an implementation of the MorpheusContext for running Future based rxJava queries
-
getPlugin
Description copied from interface:PluginProvider
Returns the instance of the Plugin class that this provider is loaded from- Specified by:
getPlugin
in 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
BackupExecutionProvider
providing methods for backup execution.
-
setExecutionProvider
Set the backup provider which will be responsible for all the operations related to backup executions.- Parameters:
executionProvider
- aBackupExecutionProvider
providing methods for backup execution.
-
getRestoreProvider
Get the backup provider which will be responsible for all the operations related to backup restore.- Returns:
- a
BackupRestoreProvider
providing methods for backup restore operations.
-
setRestoreProvider
Get the backup provider which will be responsible for all the operations related to backup restore.- Parameters:
restoreProvider
- aBackupRestoreProvider
providing methods for backup restore operations.
-
refresh
Description copied from interface:BackupTypeProvider
Refresh the provider with the associated data in the external system.- Specified by:
refresh
in interfaceBackupTypeProvider
- Parameters:
authConfig
- necessary connection and credentials to connect to the external providerbackupProvider
- 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
Description copied from interface:BackupTypeProvider
Clean up all data created by the backup type provider.- Specified by:
clean
in interfaceBackupTypeProvider
- Parameters:
backupProviderModel
- the provider to be cleaned upopts
- additional options- Returns:
- a
ServiceResponse
object
-
configureBackup
Description copied from interface:BackupTypeProvider
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.- Specified by:
configureBackup
in 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
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup creation process.
-
validateBackup
Description copied from interface:BackupTypeProvider
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.- Specified by:
validateBackup
in interfaceBackupTypeProvider
- Parameters:
backupModel
- the backup to validateconfig
- 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 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:BackupTypeProvider
Create the backup resources on the external provider system.- Specified by:
createBackup
in interfaceBackupTypeProvider
- Parameters:
backupModel
- the fully configured and validated backupopts
- 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
Description copied from interface:BackupTypeProvider
Delete the backup resources on the external provider system.- Specified by:
deleteBackup
in interfaceBackupTypeProvider
- Parameters:
backupModel
- the backup detailsopts
- 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
Description copied from interface:BackupTypeProvider
Delete the results of a backup execution on the external provider system.- Specified by:
deleteBackupResult
in interfaceBackupTypeProvider
- Parameters:
backupResultModel
- the backup result detailsopts
- 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
Description copied from interface:BackupTypeProvider
A hook into the execution process. This method is called before the backup execution occurs.- Specified by:
prepareExecuteBackup
in interfaceBackupTypeProvider
- Parameters:
backupModel
- the backup details associated with the backup executionopts
- 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
Description copied from interface:BackupTypeProvider
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.- Specified by:
prepareBackupResult
in interfaceBackupTypeProvider
- Parameters:
backupResultModel
- the backup result detailsopts
- 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
public ServiceResponse<BackupExecutionResponse> executeBackup(Backup backupModel, BackupResult backupResult, Map executionConfig, Cloud cloud, ComputeServer computeServer, Map opts) Description copied from interface:BackupTypeProvider
Initiate the backup process on the external provider system.- Specified by:
executeBackup
in 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
ServiceResponse
indicating the success or failure of the backup execution. A success value of 'false' will halt the execution process.
-
refreshBackupResult
Description copied from interface:BackupTypeProvider
Periodically call until the backup execution has successfully completed. The default refresh interval is 60 seconds.- Specified by:
refreshBackupResult
in 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 theBackupStatusUtility
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
Description copied from interface:BackupTypeProvider
Cancel the backup execution process without waiting for a result.- Specified by:
cancelBackup
in interfaceBackupTypeProvider
- 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
Description copied from interface:BackupTypeProvider
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.- Specified by:
extractBackup
in interfaceBackupTypeProvider
- 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.
-
configureRestoreBackup
Description copied from interface:BackupTypeProvider
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.- Specified by:
configureRestoreBackup
in interfaceBackupTypeProvider
- 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
public ServiceResponse getBackupRestoreInstanceConfig(BackupResult backupResultModel, Instance instanceModel, Map restoreConfig, Map opts) Description copied from interface:BackupTypeProvider
Build the configuration for the restored instance.- Specified by:
getBackupRestoreInstanceConfig
in 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
ServiceResponse
object. A ServiceResponse with a false success will indicate a failed configuration and will halt the backup restore process.
-
validateRestoreBackup
Description copied from interface:BackupTypeProvider
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.- Specified by:
validateRestoreBackup
in interfaceBackupTypeProvider
- 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
Description copied from interface:BackupTypeProvider
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
- Specified by:
getRestoreOptions
in interfaceBackupTypeProvider
- 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
public ServiceResponse<BackupRestoreResponse> restoreBackup(BackupRestore backupRestore, BackupResult backupResultModel, Backup backupModel, Map opts) Description copied from interface:BackupTypeProvider
Execute the backup restore on the external system- Specified by:
restoreBackup
in 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
ServiceResponse
object. 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:BackupTypeProvider
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.- Specified by:
refreshBackupRestoreResult
in interfaceBackupTypeProvider
- Parameters:
backupRestoreModel
- the running restorebackupResultModel
- 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.
-