* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\Delete;
use Baculum\API\Modules\BaculumAPIServer;
use Baculum\Common\Modules\Errors\JobError;
if ($result->exitcode === 0) {
$job = $this->getModule('job')->getJobById($jobid);
if(is_object($job) && in_array($job->name, $result->output)) {
- $result = $this->getModule('bconsole')->bconsoleCommand(
+ $result = $this->getModule('delete')->delete(
$this->director,
- array('delete', 'jobid="' . $job->jobid . '"')
+ Delete::TYPE_JOBID,
+ $job->jobid
);
- $this->output = $result->output;
- $this->error = $result->exitcode;
+ $this->output = $result['output'];
+ $this->error = $result['error'];
} else {
$this->output = JobError::MSG_ERROR_JOB_DOES_NOT_EXISTS;
$this->error = JobError::ERROR_JOB_DOES_NOT_EXISTS;
* Bacula(R) is a registered trademark of Kern Sibbald.
*/
+use Baculum\API\Modules\Delete;
use Baculum\API\Modules\BaculumAPIServer;
use Baculum\Common\Modules\Errors\VolumeError;
$mediaid = $this->Request->contains('id') ? intval($this->Request['id']) : 0;
$volume = $this->getModule('volume')->getVolumeById($mediaid);
if (is_object($volume)) {
- $result = $this->getModule('bconsole')->bconsoleCommand(
+ $result = $this->getModule('delete')->delete(
$this->director,
- [
- 'delete',
- 'volume="' . $volume->volumename . '"',
- 'yes'
- ]
+ Delete::TYPE_VOLUME,
+ $volume->volumename
);
- if ($result->exitcode === 0) {
- $this->output = $result->output;
- $this->error = VolumeError::ERROR_NO_ERRORS;
- } else {
- $this->output = $result->output;
- $this->error = VolumeError::ERROR_WRONG_EXITCODE;
- }
+ $this->output = $result['output'];
+ $this->error = $result['error'];
} else {
$this->output = VolumeError::MSG_ERROR_VOLUME_DOES_NOT_EXISTS;
$this->error = VolumeError::ERROR_VOLUME_DOES_NOT_EXISTS;
}
}
}
-
?>