From: Marcin Haba Date: Tue, 25 Apr 2023 14:14:18 +0000 (+0200) Subject: baculum: Add client property to object and objects endpoint X-Git-Tag: Release-13.0.3~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2423a878a7608ac655b1ffb9963dbd1c48a2236;p=thirdparty%2Fbacula.git baculum: Add client property to object and objects endpoint --- diff --git a/gui/baculum/protected/API/Modules/ObjectManager.php b/gui/baculum/protected/API/Modules/ObjectManager.php index 895146a64..061ea9deb 100644 --- a/gui/baculum/protected/API/Modules/ObjectManager.php +++ b/gui/baculum/protected/API/Modules/ObjectManager.php @@ -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); diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index 512eae022..ebd35c8d3 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -7964,6 +7964,15 @@ "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" + } } ] } @@ -10423,6 +10432,26 @@ "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" } } },