use of com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity in project coprhd-controller by CoprHD.
the class VirtualDataCenterCapacityService method getVirtualArrayVirtualPoolCapacities.
private VirtualArrayVirtualPoolCapacity getVirtualArrayVirtualPoolCapacities(URI vArrayId) {
VirtualArrayVirtualPoolCapacity vArrayCap = new VirtualArrayVirtualPoolCapacity();
vArrayCap.setId(vArrayId);
vArrayCap.setVpoolCapacities(new ArrayList<VirtualPoolCapacity>());
URIQueryResultList resultList = new URIQueryResultList();
_dbClient.queryByConstraint(ContainmentConstraint.Factory.getVirtualArrayVirtualPoolConstraint(vArrayId), resultList);
Iterator<URI> vPoolIterator = resultList.iterator();
int c = 0;
while (vPoolIterator.hasNext()) {
URI vPoolId = vPoolIterator.next();
VirtualPool vPool = _permissionsHelper.getObjectById(vPoolId, VirtualPool.class);
vArrayCap.getVpoolCapacities().add(getVirtualPoolCapacities(vArrayId, vPool));
c++;
}
logger.info("{} vpool in varray {}", c, vArrayId);
return vArrayCap;
}
use of com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity in project coprhd-controller by CoprHD.
the class VirtualDataCenterCapacityService method getZoneCapacities.
/**
* List all VirtualPool capacities under the zone grouped by varray
*
* @brief List VirtualPool capacities in the zone
* @return List of VirtualPool capacities
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public VDCCapacities getZoneCapacities() {
VDCCapacities zoneCap = new VDCCapacities();
zoneCap.setArrayCapacities(new ArrayList<VirtualArrayVirtualPoolCapacity>());
// get all varray ids
final List<URI> ids = _dbClient.queryByType(VirtualArray.class, true);
for (URI id : ids) {
zoneCap.getArrayCapacities().add(getVirtualArrayVirtualPoolCapacities(id));
}
return zoneCap;
}
Aggregations