Start of DB2 direct connection work
This commit is contained in:
@@ -17,9 +17,29 @@ class Model_FILESPACE extends ORMTSM {
|
||||
'FILESPACE_NAME'=>'ASC',
|
||||
);
|
||||
|
||||
protected $_has_one = array(
|
||||
'NODE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
|
||||
);
|
||||
|
||||
protected $_has_many = array(
|
||||
'VOLUMEUSAGE'=>array('foreign_key'=>array('NODE_NAME'=>'NODE_NAME','FILESPACE_NAME'=>'FILESPACE_NAME')),
|
||||
'OCCUPANCY'=>array('foreign_key'=>array('NODE_NAME'=>'NODE_NAME','FILESPACE_NAME'=>'FILESPACE_NAME')),
|
||||
);
|
||||
|
||||
protected $_tsm = array(
|
||||
'db2'=>array(
|
||||
'_primary_key'=>'FSNAME',
|
||||
'_sorting'=>array(
|
||||
'NODEID'=>'ASC',
|
||||
'FSNAME'=>'ASC',
|
||||
),
|
||||
'_has_one'=>array(
|
||||
'NODE'=>array('foreign_key'=>'NODEID','far_key'=>'NODEID'),
|
||||
),
|
||||
'translate'=>array(
|
||||
'FILESPACE_NAME'=>'FSNAME',
|
||||
'BACKUP_END'=>'BACKSTART',
|
||||
'PCT_UTIL'=>NULL,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
@@ -29,16 +49,17 @@ class Model_FILESPACE extends ORMTSM {
|
||||
);
|
||||
|
||||
public function utilsation() {
|
||||
return $this->CAPACITY * ($this->PCT_UTIL/100);
|
||||
return $this->CAPACITY*($this->PCT_UTIL/100);
|
||||
}
|
||||
|
||||
// $dtype must be Bkup or Arch
|
||||
public function storagepools($dtype) {
|
||||
$pool = array();
|
||||
|
||||
foreach ($this->OCCUPANCY
|
||||
foreach ($this->NODE->OCC
|
||||
->select('STGPOOL_NAME')
|
||||
->where('TYPE','=',$dtype)
|
||||
->and_where('FILESPACE_NAME','=',$this->FILESPACE_NAME)
|
||||
->group_by('STGPOOL_NAME')
|
||||
->order_by('STGPOOL_NAME')
|
||||
->find_all() as $oo)
|
||||
@@ -49,11 +70,19 @@ class Model_FILESPACE extends ORMTSM {
|
||||
}
|
||||
|
||||
public function pool_logical_util($pool,$btype) {
|
||||
return $this->OCCUPANCY->where('STGPOOL_NAME','=',$pool)->where('TYPE','=',$btype)->find()->LOGICAL_MB;
|
||||
return $this->NODE->OCC
|
||||
->where('STGPOOL_NAME','=',$pool)
|
||||
->and_where('TYPE','=',$btype)
|
||||
->and_where('FILESPACE_NAME','=',$this->FILESPACE_NAME)
|
||||
->find()->LOGICAL_MB;
|
||||
}
|
||||
|
||||
public function pool_numvols($pool,$ctype) {
|
||||
return $this->VOLUMEUSAGE->where('STGPOOL_NAME','=',$pool)->where('COPY_TYPE','=',$ctype)->find_all()->count();
|
||||
return $this->NODE->VOLUMEUSAGE
|
||||
->where('STGPOOL_NAME','=',$pool)
|
||||
->and_where('COPY_TYPE','=',$ctype)
|
||||
->and_where('FILESPACE_NAME','=',$this->FILESPACE_NAME)
|
||||
->find_all()->count();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user