Add backup file extraction feature - #13935
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #13935 +/- ##
==========================================
Coverage 19.65% 19.66%
- Complexity 19798 19833 +35
==========================================
Files 6368 6383 +15
Lines 574943 575857 +914
Branches 70355 70444 +89
==========================================
+ Hits 113015 113230 +215
- Misses 449658 450336 +678
- Partials 12270 12291 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
It would be nice if someone could test this using RPM, since I have not tested installing the RPM packages. |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 18962 |
|
|
||
| @APICommand(name = "downloadBackupFile", | ||
| description = "Download a file from a backup", | ||
| responseObject = ExtractResponse.class, since = "4.24.0.0") |
There was a problem hiding this comment.
| responseObject = ExtractResponse.class, since = "4.24.0.0") | |
| responseObject = ExtractResponse.class, since = "24.0.0") |
|
|
||
| @APICommand(name = "listBackupFiles", | ||
| description = "List a backup inner files", | ||
| responseObject = DataStoreObjectResponse.class, since = "4.24.0.0") |
There was a problem hiding this comment.
| responseObject = DataStoreObjectResponse.class, since = "4.24.0.0") | |
| responseObject = DataStoreObjectResponse.class, since = "24.0.0") |
|
|
||
| @APICommand(name = "listBackupFilesystems", | ||
| description = "List a backup inner file systems", | ||
| responseObject = DataStoreObjectResponse.class, since = "4.24.0.0") |
There was a problem hiding this comment.
| responseObject = DataStoreObjectResponse.class, since = "4.24.0.0") | |
| responseObject = DataStoreObjectResponse.class, since = "24.0.0") |
| private String path; | ||
|
|
||
| @Parameter(name = ApiConstants.IS_SYMLINK, type = CommandType.BOOLEAN, | ||
| description = "Path to list files in the backed-up volume.") |
There was a problem hiding this comment.
| description = "Path to list files in the backed-up volume.") | |
| description = "Indicates whether the path references a symlink.") |
| } | ||
|
|
||
| /** | ||
| * Given the directory, file list and details of those files, will populate the names, paths, canonicalPaths, isDirs, isSymlinks, sizes and modifiedList lists. |
There was a problem hiding this comment.
| * Given the directory, file list and details of those files, will populate the names, paths, canonicalPaths, isDirs, isSymlinks, sizes and modifiedList lists. | |
| * Given the directory, file list, and details of those files, will populate the names, paths, canonicalPaths, isDirs, isSymlinks, sizes and modifiedList lists. |
An oxford comma here makes it more readable IMO.
| Long vmId = backupVO.getVmId(); | ||
| VMInstanceVO vm = vmInstanceDao.findByIdIncludingRemoved(vmId); | ||
| if (vm == null) { | ||
| throw new CloudRuntimeException(String.format("Unable to find VM for backup [%s].", backupVO.getUuid())); |
There was a problem hiding this comment.
| throw new CloudRuntimeException(String.format("Unable to find VM for backup [%s].", backupVO.getUuid())); | |
| throw new CloudRuntimeException(String.format("Unable to find VM from backup [%s].", backupVO.getUuid())); |
Description
This PR adds backup file extraction feature. Currently only supported by KBOSS.
This feature must be enabled in the backup offering through the
allowextractfileparameter. If it is set totrue, it will be possible to extract files from backups created with that offering.The
listBackupFilesystemsAPI was added to allow listing file systems inside backup volumes:backupIdvolumeIdExample execution of the
listBackupFilesystemsAPIThe
listBackupFilesAPI was added to allow listing files inside backup volumes:backupIdvolumeIdfilesystempathissymlinkThe
filesystemandpathparameters expect that the files do not contain special characters such as(,|, or>, for example. Both are expected to receive values in the format/path/to/something.Example execution of the
listBackupFilesAPITo download files, the
downloadBackupFileAPI was added:backupIdvolumeIdfilesystempathgzip; if it is a directory, it will be added to atararchive and compressed usinggzipThe
filesystemandpathparameters expect that the files do not contain special characters such as(,|, or>, for example. Both are expected to receive values in the format/path/to/something.Example execution of the
downloadBackupFileAPIThe list and download file workflow was also added to the GUI.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Test descriptions
isSymlink=trueflagisSymlinkflagAll the tests above were executed for both Linux ROOT volumes (ext4) and Windows ROOT volumes (NTFS).