]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Unify /jobs/{jobid}/files endpoint output for detailed and normal modes
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 5 Mar 2021 03:58:15 +0000 (04:58 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 7 Mar 2021 12:06:24 +0000 (13:06 +0100)
gui/baculum/protected/API/Pages/API/JobListFiles.php
gui/baculum/protected/API/openapi_baculum.json

index 716b80ed0694c0d860822cdf181e373906b85eb7..a01cfe3d5ce7043a7e73b70a5ba2634656469673 100644 (file)
@@ -63,11 +63,13 @@ class JobListFiles extends BaculumAPIServer {
                                                'limit' => $limit,
                                                'search' => $search
                                        ]);
-                                       //NOTE: Standarize raw and json output in new version API v2
-                                       $result = [
-                                               'items' => $result,
-                                               'totals' => count($result)
-                                       ];
+                                       if (APIServer::getVersion() === 1) {
+                                               // TODO: Remove it when APIv1 will not be used
+                                               $result = [
+                                                       'items' => $result,
+                                                       'totals' => count($result)
+                                               ];
+                                       }
                                }
                                $this->output = $result;
                                $this->error = GenericError::ERROR_NO_ERRORS;
index af963dca8404b7060ca332b919cbb58d5f448673..909a293bf13276567c5ae9ef03ab9a11a467e2bd 100644 (file)
                                                                        "type": "object",
                                                                        "properties": {
                                                                                "output": {
-                                                                                       "type": "object",
-                                                                                       "properties": {
-                                                                                               "items": {
-                                                                                                       "type": "array",
-                                                                                                       "items": {
-                                                                                                               "type": "string",
-                                                                                                               "description": "Show job files output list"
-                                                                                                       }
-                                                                                               },
-                                                                                               "total": {
-                                                                                                       "type": "integer",
-                                                                                                       "description": "Total number of items"
-                                                                                               }
+                                                                                       "type": "array",
+                                                                                       "items": {
+                                                                                               "type": "string",
+                                                                                               "description": "Job files output list"
                                                                                        }
                                                                                },
                                                                                "error": {