Request['id']); $volume = $this->getModule('volume')->getVolumeById($mediaid); if(!is_null($volume)) { $this->output = $volume; $this->error = VolumeError::ERROR_NO_ERRORS; } else { $this->output = VolumeError::MSG_ERROR_VOLUME_DOES_NOT_EXISTS; $this->error = VolumeError::ERROR_VOLUME_DOES_NOT_EXISTS; } } public function set($id, $params) { $volume = $this->getModule('volume')->getVolumeById($id); if (is_object($volume)) { $cmd = array('update', 'volume="' . $volume->volumename . '"'); if(property_exists($params, 'volstatus')) { $cmd[] = 'volstatus="' . $params->volstatus . '"'; } if(property_exists($params, 'poolid')) { $pool = $this->getModule('pool')->getPoolById($params->poolid); if (is_object($pool)) { $cmd[] = 'pool="' . $pool->name . '"'; } } if(property_exists($params, 'volretention')) { $cmd[] = 'volretention="' . $params->volretention . '"'; } if(property_exists($params, 'voluseduration')) { $cmd[] = 'voluseduration="' . $params->voluseduration . '"'; } if(property_exists($params, 'maxvoljobs')) { $cmd[] = 'maxvoljobs="' . $params->maxvoljobs . '"'; } if(property_exists($params, 'maxvolfiles')) { $cmd[] = 'maxvolfiles="' . $params->maxvolfiles . '"'; } if(property_exists($params, 'maxvolbytes')) { $cmd[] = 'maxvolbytes="' . $params->maxvolbytes . '"'; } if(property_exists($params, 'slot')) { $cmd[] = 'slot="' . $params->slot . '"'; } if(property_exists($params, 'recycle')) { $cmd[] = 'recycle="' . ($params->recycle ? 'yes' : 'no') . '"'; } if(property_exists($params, 'enabled')) { $cmd[] = 'enabled="' . ($params->enabled ? 'yes' : 'no') . '"'; } if(property_exists($params, 'inchanger')) { $cmd[] = 'inchanger="' . ($params->inchanger ? 'yes' : 'no') . '"'; } $result = $this->getModule('bconsole')->bconsoleCommand($this->director, $cmd); $this->output = $result->output; $this->error = $result->exitcode; } else { $this->output = VolumeError::MSG_ERROR_VOLUME_DOES_NOT_EXISTS; $this->error = VolumeError::ERROR_VOLUME_DOES_NOT_EXISTS; } } } ?>