From: Marcin Haba Date: Fri, 3 Mar 2023 15:21:01 +0000 (+0100) Subject: baculum: Add fileindex parameter to bvfs restore endpoint X-Git-Tag: Release-13.0.3~120 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ab1e1daf92862de2f28ef6ba1e205961d374593;p=thirdparty%2Fbacula.git baculum: Add fileindex parameter to bvfs restore endpoint --- diff --git a/gui/baculum/protected/API/Pages/API/BVFSRestore.php b/gui/baculum/protected/API/Pages/API/BVFSRestore.php index 93c6db349..b40275a46 100644 --- a/gui/baculum/protected/API/Pages/API/BVFSRestore.php +++ b/gui/baculum/protected/API/Pages/API/BVFSRestore.php @@ -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 . '"'); } diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index d1e8d07ee..c1a20368d 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -5352,7 +5352,16 @@ { "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"