Skip to content

Commit

Permalink
feat(api): Add OJO analysis to REST API
Browse files Browse the repository at this point in the history
Signed-off-by: Gaurav Mishra <mishra.gaurav@siemens.com>
  • Loading branch information
GMishx committed Sep 13, 2019
1 parent 12f064a commit 7a190c1
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/www/ui/api/Models/Analysis.php
Expand Up @@ -64,6 +64,11 @@ class Analysis
* Whether to schedule nomos agent or not
*/
private $nomos;
/**
* @var boolean $ojo
* Whether to schedule ojo agent or not
*/
private $ojo;
/**
* @var boolean $pkgagent
* Whether to schedule package agent or not
Expand All @@ -79,10 +84,11 @@ class Analysis
* @param boolean $mime
* @param boolean $monk
* @param boolean $nomos
* @param boolean $ojo
* @param boolean $package
*/
public function __construct($bucket = false, $copyright = false, $ecc = false, $keyword = false,
$mimetype = false, $monk = false, $nomos = false, $pkgagent = false)
$mimetype = false, $monk = false, $nomos = false, $ojo = false, $pkgagent = false)
{
$this->bucket = $bucket;
$this->copyright = $copyright;
Expand All @@ -91,6 +97,7 @@ public function __construct($bucket = false, $copyright = false, $ecc = false, $
$this->mimetype = $mimetype;
$this->monk = $monk;
$this->nomos = $nomos;
$this->ojo = $ojo;
$this->pkgagent = $pkgagent;
}

Expand Down Expand Up @@ -126,6 +133,9 @@ public function setUsingArray($analysisArray)
if (array_key_exists("nomos", $analysisArray)) {
$this->nomos = filter_var($analysisArray["nomos"], FILTER_VALIDATE_BOOLEAN);
}
if (array_key_exists("ojo", $analysisArray)) {
$this->ojo = filter_var($analysisArray["ojo"], FILTER_VALIDATE_BOOLEAN);
}
if (array_key_exists("package", $analysisArray)) {
$this->pkgagent = filter_var($analysisArray["package"],
FILTER_VALIDATE_BOOLEAN);
Expand Down Expand Up @@ -161,6 +171,9 @@ public function setUsingString($analysisString)
if (stristr($analysisString, "nomos")) {
$this->nomos = true;
}
if (stristr($analysisString, "ojo")) {
$this->ojo = true;
}
if (stristr($analysisString, "pkgagent")) {
$this->pkgagent = true;
}
Expand Down Expand Up @@ -224,6 +237,14 @@ public function getNomos()
return $this->nomos;
}

/**
* @return boolean
*/
public function getOjo()
{
return $this->ojo;
}

/**
* @return boolean
*/
Expand Down Expand Up @@ -289,6 +310,14 @@ public function setNomos($nomos)
$this->nomos = filter_var($nomos, FILTER_VALIDATE_BOOLEAN);
}

/**
* @param boolean $ojo
*/
public function setOjo($ojo)
{
$this->ojo = filter_var($ojo, FILTER_VALIDATE_BOOLEAN);
}

/**
* @param boolean $package
*/
Expand All @@ -311,6 +340,7 @@ public function getArray()
"mimetype" => $this->mimetype,
"monk" => $this->monk,
"nomos" => $this->nomos,
"ojo" => $this->ojo,
"package" => $this->pkgagent
];
}
Expand Down
3 changes: 3 additions & 0 deletions src/www/ui/api/documentation/openapi.yaml
Expand Up @@ -843,6 +843,9 @@ components:
nomos:
type: boolean
description: Should Nomos Analysis be run on this upload.
ojo:
type: boolean
description: Should OJO Analysis be run on this upload.
package:
type: boolean
description: Should Package Analysis be run on this upload.
Expand Down

0 comments on commit 7a190c1

Please sign in to comment.