Added volumes for a node

Added schedules
Added management classes for a node
Added clientopts to nodes
Added schedule and event information
This commit is contained in:
Deon George
2011-05-24 01:04:40 +10:00
parent a244d693b5
commit 58ddb97d87
24 changed files with 650 additions and 171 deletions

View File

@@ -11,18 +11,21 @@
*/
class Model_FILESPACE extends ORMTSM {
protected $_table_name = 'FILESPACES';
protected $_primary_key = 'FILESPACE_NAME';
protected $_primary_key = 'FILESPACE_NAME'; // We need a primary key to detect that the object is loaded.
protected $_sorting = array(
'NODE_NAME'=>'ASC',
'FILESPACE_NAME'=>'ASC',
);
protected $_has_many = array(
'VOLUMEUSAGE'=>array('foreign_key'=>array('NODE_NAME','FILESPACE_NAME'),'far_key'=>'FILESPACE_NAME'),
'OCCUPANCY'=>array('foreign_key'=>array('NODE_NAME','FILESPACE_NAME'),'far_key'=>'FILESPACE_NAME'),
);
protected $_formats = array(
'BACKUP_END'=>array('ORMTSM::date'=>array('d-M-Y')),
);
protected $_sorting = array(
'NODE_NAME'=>'ASC',
protected $_display_filters = array(
'BACKUP_END'=>array(
array('ORMTSM::date',array(':value','d-M-Y')),
),
);
public function utilsation() {
@@ -37,20 +40,20 @@ class Model_FILESPACE extends ORMTSM {
->where('TYPE','=',$dtype)
->group_by('STGPOOL_NAME')
->order_by('STGPOOL_NAME')
->find_all() as $vo) {
->find_all() as $oo) {
array_push($pool,$vo->STGPOOL_NAME);
array_push($pool,$oo->STGPOOL);
}
return $pool;
}
public function pool_logical_util($pool) {
return $this->OCCUPANCY->where('STGPOOL_NAME','=',$pool)->find()->LOGICAL_MB;
public function pool_logical_util($pool,$btype) {
return $this->OCCUPANCY->where('STGPOOL_NAME','=',$pool)->where('TYPE','=',$btype)->find()->LOGICAL_MB;
}
public function pool_numvols($pool) {
return $this->VOLUMEUSAGE->where('STGPOOL_NAME','=',$pool)->find_all()->count();
public function pool_numvols($pool,$ctype) {
return $this->VOLUMEUSAGE->where('STGPOOL_NAME','=',$pool)->where('COPY_TYPE','=',$ctype)->find_all()->count();
}
}
?>