]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Add client property to object and objects endpoint
authorMarcin Haba <marcin.haba@bacula.pl>
Tue, 25 Apr 2023 14:14:18 +0000 (16:14 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Mon, 1 May 2023 11:18:25 +0000 (13:18 +0200)
gui/baculum/protected/API/Modules/ObjectManager.php
gui/baculum/protected/API/openapi_baculum.json

index 895146a64f01297aae9e3a4be5932333fc078ba6..061ea9deb44bb71fb927e8c1805cea1925d61523 100644 (file)
@@ -107,13 +107,14 @@ class ObjectManager extends APIModule
 
                $where = Database::getWhere($criteria);
 
-               $obj_record = 'Object.*, Job.Name AS jobname, Job.JobErrors AS joberrors, Job.JobStatus AS jobstatus ';
+               $obj_record = 'Object.*, Job.Name AS jobname, Job.JobErrors AS joberrors, Job.JobStatus AS jobstatus, Client.Name AS client';
                if ($view == self::OBJ_RESULT_VIEW_BASIC) {
                        $obj_record = implode(',', $this->basic_mode_obj_props);
                }
                $sql = 'SELECT ' . $obj_record . ' 
 FROM Object 
-JOIN Job USING (JobId) '
+JOIN Job USING (JobId) 
+LEFT JOIN Client USING (ClientId) '
 . $where['where'] . $order . $limit . $offset;
                $statement = Database::runQuery($sql, $where['params']);
                $result = $statement->fetchAll(\PDO::FETCH_OBJ);
index 512eae0229408ce2e405a580ff26b0bc79d38388..ebd35c8d33550473fb2aef0eb18fde26994c1bfc 100644 (file)
                                                "schema": {
                                                        "type": "boolean"
                                                }
+                                       },
+                                       {
+                                               "name": "joberrors",
+                                               "in": "query",
+                                               "required": false,
+                                               "description": "Show objects from jobs that contain or that do not contain errors.",
+                                               "schema": {
+                                                       "type": "boolean"
+                                               }
                                        }
                                ]
                        }
                                "objectcount": {
                                        "description": "Object count",
                                        "type": "integer"
+                               },
+                               "fileindex": {
+                                       "description": "Object file index",
+                                       "type": "integer"
+                               },
+                               "jobname": {
+                                       "description": "Object job name",
+                                       "type": "string"
+                               },
+                               "joberrors": {
+                                       "description": "Object job errors",
+                                       "type": "integer"
+                               },
+                               "jobstatus": {
+                                       "description": "Object job status",
+                                       "type": "integer"
+                               },
+                               "client": {
+                                       "description": "Object job client",
+                                       "type": "string"
                                }
                        }
                },