Search in sources :

Example 1 with VirtualArrayVirtualPoolCapacity

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;
}
Also used : VirtualPoolCapacity(com.emc.storageos.model.vpool.VirtualPoolCapacity) VirtualArrayVirtualPoolCapacity(com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity) VirtualPool(com.emc.storageos.db.client.model.VirtualPool) URI(java.net.URI) VirtualArrayVirtualPoolCapacity(com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity) URIQueryResultList(com.emc.storageos.db.client.constraint.URIQueryResultList) ContainmentConstraint(com.emc.storageos.db.client.constraint.ContainmentConstraint)

Example 2 with VirtualArrayVirtualPoolCapacity

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;
}
Also used : URI(java.net.URI) VDCCapacities(com.emc.storageos.model.vpool.VDCCapacities) VirtualArrayVirtualPoolCapacity(com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

VirtualArrayVirtualPoolCapacity (com.emc.storageos.model.vpool.VirtualArrayVirtualPoolCapacity)2 URI (java.net.URI)2 ContainmentConstraint (com.emc.storageos.db.client.constraint.ContainmentConstraint)1 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)1 VDCCapacities (com.emc.storageos.model.vpool.VDCCapacities)1 VirtualPoolCapacity (com.emc.storageos.model.vpool.VirtualPoolCapacity)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 GET (javax.ws.rs.GET)1 Produces (javax.ws.rs.Produces)1