]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add fileindex parameter to bvfs restore endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 3 Mar 2023 15:21:01 +0000 (16:21 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 5 Mar 2023 06:06:30 +0000 (07:06 +0100)
gui/baculum/protected/API/Pages/API/BVFSRestore.php
gui/baculum/protected/API/openapi_baculum.json

index 93c6db3495644bd4cdc2a4089a125da14c6806b9..b40275a46964415c8a54ed38975c29a590ace84d 100644 (file)
@@ -37,7 +37,12 @@ class BVFSRestore extends BaculumAPIServer {
                $jobids = property_exists($params, 'jobids') ? $params->jobids : null;
                $fileids = property_exists($params, 'fileid') ? $params->fileid : null;
                $dirids = property_exists($params, 'dirid') ? $params->dirid : null;
+               /**
+                * Name for findex is wrong. In the next version of API change it
+                * from 'findex' into 'hardlink'.
+                */
                $findexes = property_exists($params, 'findex') ? $params->findex : null;
+               $fileindexes = property_exists($params, 'fileindex') ? $params->fileindex : null;
                $objectids = property_exists($params, 'objectid') ? $params->objectid : null;
                $path = property_exists($params, 'path') ? $params->path : null;
 
@@ -83,6 +88,9 @@ class BVFSRestore extends BaculumAPIServer {
                if (is_string($findexes)) {
                        array_push($cmd, 'hardlink="' . $findexes . '"');
                }
+               if (is_string($fileindexes)) {
+                       array_push($cmd, 'fileindex="' . $fileindexes . '"');
+               }
                if (is_string($objectids)) {
                        array_push($cmd, 'objectid="' . $objectids . '"');
                }
index d1e8d07ee66933a7f049721346347cd408206c13..c1a20368dbb743c730c0c4ee8289953d907e0e92 100644 (file)
                                        {
                                                "name": "findex",
                                                "in": "body",
-                                               "description": "Comma seprated directory file indexes",
+                                               "description": "For using restore with preserved hardlink. Comma seprated file indexes together with corresponding jobids in form jobid1,fileindex1,jobid2,fileindex2...etc.",
+                                               "required": false,
+                                               "schema": {
+                                                       "type": "string"
+                                               }
+                                       },
+                                       {
+                                               "name": "fileindex",
+                                               "in": "body",
+                                               "description": "For restoring by file index. Comma seprated file indexes together with corresponding jobids in form jobid1,fileindex1,jobid2,fileindex2...etc.",
                                                "required": false,
                                                "schema": {
                                                        "type": "string"