Package com.morpheusdata.core.backup
Interface BackupTypeProvider
- All Superinterfaces:
PluginProvider
- All Known Implementing Classes:
AbstractBackupTypeProvider
,AbstractMorpheusBackupTypeProvider
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 Summary
Modifier and TypeMethodDescriptioncancelBackup
(BackupResult backupResult, Map opts) Cancel the backup execution process without waiting for a result.clean
(BackupProvider backupProvider, Map opts) Clean up all data created by the backup type provider.configureBackup
(Backup backup, Map config, Map opts) Add additional configurations to a backup.configureRestoreBackup
(BackupResult backupResult, Map config, Map opts) Add additional configurations to a backup restore.createBackup
(Backup backup, Map opts) Create the backup resources on the external provider system.deleteBackup
(Backup backup, Map opts) Delete the backup resources on the external provider system.deleteBackupResult
(BackupResult backupResult, Map opts) Delete the results of a backup execution on the external provider system.executeBackup
(Backup backup, BackupResult backupResult, Map executionConfig, Cloud cloud, ComputeServer computeServer, Map opts) Initiate the backup process on the external provider system.extractBackup
(BackupResult backupResult, Map opts) Extract the results of a backup.getBackupRestoreInstanceConfig
(BackupResult backupResult, Instance instance, Map restoreConfig, Map opts) Build the configuration for the restored instance.get the type of container compatible with this backup typeDetermines if this backup type supports copying the backup to a datastore (export).Determines if this backup type supports downloading the backups for this backup type.Does this backup type provider support copy to store?A list ofOptionTypes
for use in the backup create and edit forms.Determines if this backup type supports restoring a backup to the existing workload.Determines if this backup type supports restoring to a new workload rather than replacing the existing workload.Get the desired method of restoring a backup to a new instance.getRestoreOptions
(Backup backup, Map opts) Get restore options to configure the restore wizard.Indicates the type of restore supported.default Boolean
Determines if this backup type relies on a snapshot process.prepareBackupResult
(BackupResult backupResult, Map opts) Provide additional configuration on the backup result.prepareExecuteBackup
(Backup backup, 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 backupRestore, BackupResult backupResult) 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 backupResult, Backup backup, Map opts) Execute the backup restore on the external systemvalidateBackup
(Backup backup, Map config, Map opts) Validate the configuration of the backup.validateRestoreBackup
(BackupResult backupResult, Map opts) Verify the backup restore is valid.Methods inherited from interface com.morpheusdata.core.providers.PluginProvider
getCode, getMorpheus, getName, getPlugin, isPlugin
-
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
-
isSnapshot
Determines if this backup type relies on a snapshot process. Snapshots are typically used for quick backups and are not designed for long-term storage. For long-term backup creation, additional processes, such as copy to store, should be utilized by providers that rely on snapshots. -
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 ofOptionTypes
for use in the backup create and edit forms.- Returns:
- a list of option types
-
refresh
Refresh the provider with the associated data in the external system.- 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
Clean up all data created by the backup type provider.- Parameters:
backupProvider
- the provider to be cleaned upopts
- additional options- Returns:
- a
ServiceResponse
object
-
configureBackup
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
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 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
Create the backup resources on the external provider system.- Parameters:
backup
- 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
Delete the backup resources on the external provider system.- Parameters:
backup
- 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
Delete the results of a backup execution on the external provider system.- Parameters:
backupResult
- 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
A hook into the execution process. This method is called before the backup execution occurs.- Parameters:
backup
- 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
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 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
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 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
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 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
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
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
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 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
ServiceResponse getBackupRestoreInstanceConfig(BackupResult backupResult, Instance instance, Map restoreConfig, Map opts) Build the configuration for the restored instance.- Parameters:
backupResult
- backup result to be restoredinstance
- 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
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 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
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
- Parameters:
backup
- 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
ServiceResponse<BackupRestoreResponse> restoreBackup(BackupRestore backupRestore, BackupResult backupResult, Backup backup, Map opts) Execute the backup restore on the external system- Parameters:
backupRestore
- restore to be executedbackupResult
- refernce to the backup resultbackup
- 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
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 restorebackupResult
- 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.
-