CLOUDSTACK-4392: API volumeresponse - return primary storage information to ROOT and resource domain admin only.

This commit is contained in:
Alena Prokharchyk 2013-08-21 15:33:17 -07:00
parent 4ca24928e9
commit d5379b8704
1 changed files with 10 additions and 9 deletions

View File

@ -167,16 +167,17 @@ public class VolumeJoinDaoImpl extends GenericDaoBase<VolumeJoinVO, Long> implem
volResponse.setBytesWriteRate(volume.getBytesReadRate());
volResponse.setIopsReadRate(volume.getIopsWriteRate());
volResponse.setIopsWriteRate(volume.getIopsWriteRate());
}
Long poolId = volume.getPoolId();
String poolName = (poolId == null) ? "none" : volume.getPoolName();
volResponse.setStoragePoolName(poolName);
// return hypervisor for ROOT and Resource domain only
if ((caller.getType() == Account.ACCOUNT_TYPE_ADMIN || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN)
&& volume.getState() != Volume.State.UploadOp && volume.getHypervisorType() != null) {
volResponse.setHypervisor(volume.getHypervisorType().toString());
// return hypervisor and storage pool info for ROOT and Resource domain only
if (caller.getType() == Account.ACCOUNT_TYPE_ADMIN || caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) {
if (volume.getState() != Volume.State.UploadOp && volume.getHypervisorType() != null) {
volResponse.setHypervisor(volume.getHypervisorType().toString());
}
Long poolId = volume.getPoolId();
String poolName = (poolId == null) ? "none" : volume.getPoolName();
volResponse.setStoragePoolName(poolName);
}
volResponse.setAttached(volume.getAttached());