Additional info for node display
This commit is contained in:
@@ -132,8 +132,12 @@ class Model_NODE extends ORMTSM {
|
||||
return $this->pools[$dtype];
|
||||
}
|
||||
|
||||
public function getAllStoragePoolsType($ptype) {
|
||||
return array_merge($this->getStoragePoolsType('Bkup',$ptype),$this->getStoragePoolsType('Arch',$ptype));
|
||||
}
|
||||
|
||||
// Return the storage pools used for a backup type
|
||||
// $dtype is BACKUP or ARCHIVE
|
||||
// $dtype is BACKUP (Bkup) or ARCHIVE (Arch)
|
||||
// $ptype is pool type (PRIMARY,ACTIVE,COPY)
|
||||
public function getStoragePoolsType($dtype,$ptype) {
|
||||
if (! isset($this->pools[$dtype]))
|
||||
@@ -143,24 +147,36 @@ class Model_NODE extends ORMTSM {
|
||||
}
|
||||
|
||||
// @todo This routine should be cached.
|
||||
public function getStorageTypeFiles($type) {
|
||||
public function getStorageTypeVols($type,$spo='') {
|
||||
$count = array();
|
||||
|
||||
foreach ($this->VOLUMEUSAGE->find_all() as $vo)
|
||||
if ((! $spo OR $vo->STGPOOL_NAME == $spo) AND $vo->STGPOOL->POOLTYPE == $type)
|
||||
if (! in_array($vo->VOLUME_NAME,$count))
|
||||
array_push($count,$vo->VOLUME_NAME);
|
||||
|
||||
return count($count);
|
||||
}
|
||||
|
||||
// @todo This routine should be cached.
|
||||
public function getStorageTypeFiles($type,$spo='') {
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->FILESPACE->find_all() as $fo)
|
||||
foreach ($fo->OCCUPANCY->find_all() as $oa)
|
||||
if ($oa->STGPOOL->POOLTYPE == $type)
|
||||
if ((! $spo OR $oa->STGPOOL_NAME == $spo) AND $oa->STGPOOL->POOLTYPE == $type)
|
||||
$count += $oa->NUM_FILES;
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
// @todo This routine should be cached.
|
||||
public function getStorageTypeData($type) {
|
||||
public function getStorageTypeData($type,$spo='') {
|
||||
$count = 0;
|
||||
|
||||
foreach ($this->FILESPACE->find_all() as $fo)
|
||||
foreach ($fo->OCCUPANCY->find_all() as $oa)
|
||||
if ($oa->STGPOOL->POOLTYPE == $type)
|
||||
if ((! $spo OR $oa->STGPOOL_NAME == $spo) AND $oa->STGPOOL->POOLTYPE == $type)
|
||||
$count += $oa->LOGICAL_MB;
|
||||
|
||||
return $count;
|
||||
|
Reference in New Issue
Block a user