From: Marcin Haba Date: Wed, 14 Jun 2023 11:21:45 +0000 (+0200) Subject: baculum: Add objectname parameter to jobs objects endpoint X-Git-Tag: Release-13.0.4~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b6e10ece03b72681995eb2297ae624e1cc173b2;p=thirdparty%2Fbacula.git baculum: Add objectname parameter to jobs objects endpoint --- diff --git a/gui/baculum/protected/API/Pages/API/JobsObjects.php b/gui/baculum/protected/API/Pages/API/JobsObjects.php index 68f0b03e5..038707e7a 100644 --- a/gui/baculum/protected/API/Pages/API/JobsObjects.php +++ b/gui/baculum/protected/API/Pages/API/JobsObjects.php @@ -51,6 +51,7 @@ class JobsObjects extends BaculumAPIServer { $clientid = $this->Request->contains('clientid') ? $this->Request['clientid'] : null; $client = $this->Request->contains('client') ? $this->Request['client'] : null; $objecttype = $this->Request->contains('objecttype') && $misc->isValidName($this->Request['objecttype']) ? $this->Request['objecttype'] : null; + $objectname = $this->Request->contains('objectname') && $misc->isValidName($this->Request['objectname']) ? $this->Request['objectname'] : null; $joberrors = null; if ($this->Request->contains('joberrors') && $misc->isValidBoolean($this->Request['joberrors'])) { $joberrors = $misc->isValidBooleanTrue($this->Request['joberrors']) ? true : false; @@ -108,6 +109,13 @@ class JobsObjects extends BaculumAPIServer { ]; } + if (is_string($objectname)) { + $params['Object.ObjectName'] = []; + $params['Object.ObjectName'][] = [ + 'vals' => $objectname + ]; + } + if (!empty($jobids)) { /** * If jobids parameter provided, all other parameters are not used. diff --git a/gui/baculum/protected/API/openapi_baculum.json b/gui/baculum/protected/API/openapi_baculum.json index 16413e007..cffc33901 100644 --- a/gui/baculum/protected/API/openapi_baculum.json +++ b/gui/baculum/protected/API/openapi_baculum.json @@ -2169,6 +2169,15 @@ "type": "string" } }, + { + "name": "objectname", + "in": "query", + "required": false, + "description": "Job object name (ex. main-db123, Note4..etc.)", + "schema": { + "type": "string" + } + }, { "name": "schedtime_from", "in": "query", @@ -8618,6 +8627,10 @@ "type": "string", "description": "Object status" }, + "objectsource": { + "type": "string", + "description": "Object source" + }, "jobstatus": { "type": "string", "description": "Job status"