Search in sources :

Example 21 with ComputeVirtualPool

use of com.emc.storageos.db.client.model.ComputeVirtualPool in project coprhd-controller by CoprHD.

the class ComputeVirtualPoolService method updateOtherPoolsComputeElements.

private void updateOtherPoolsComputeElements(ComputeVirtualPool computeVirtualPoolToIgnore) {
    List<URI> computeVirtualPoolUris = _dbClient.queryByType(ComputeVirtualPool.class, true);
    Collection<ComputeVirtualPool> computeVirtualPools = _dbClient.queryObject(ComputeVirtualPool.class, computeVirtualPoolUris);
    for (ComputeVirtualPool computeVirtualPool : computeVirtualPools) {
        if (computeVirtualPool.getId().equals(computeVirtualPoolToIgnore.getId())) {
            continue;
        }
        if (computeVirtualPool.getUseMatchedElements()) {
            getMatchingCEsforCVPAttributes(computeVirtualPool);
            _dbClient.updateAndReindexObject(computeVirtualPool);
        }
    }
}
Also used : URI(java.net.URI) ComputeVirtualPool(com.emc.storageos.db.client.model.ComputeVirtualPool) ComputeVirtualPoolMapper.toComputeVirtualPool(com.emc.storageos.api.mapper.ComputeVirtualPoolMapper.toComputeVirtualPool)

Example 22 with ComputeVirtualPool

use of com.emc.storageos.db.client.model.ComputeVirtualPool in project coprhd-controller by CoprHD.

the class ComputeVirtualPoolService method recordOperation.

public void recordOperation(OperationTypeEnum opType, String evDesc, Object... extParam) {
    String evType;
    evType = opType.getEvType(true);
    _log.info("opType: {} detail: {}", opType.toString(), evType + ':' + evDesc);
    ComputeVirtualPool computeVpool = (ComputeVirtualPool) extParam[0];
    recordVirtualPoolEvent(evType, evDesc, computeVpool.getId());
    StringBuilder vArrays = new StringBuilder();
    if (computeVpool.getVirtualArrays() != null) {
        for (String varray : computeVpool.getVirtualArrays()) {
            vArrays.append(" ");
            vArrays.append(varray);
        }
    }
    switch(opType) {
        case CREATE_COMPUTE_VPOOL:
            auditOp(opType, true, null, computeVpool.getId().toString(), computeVpool.getLabel(), computeVpool.getSystemType(), vArrays.toString());
            break;
        case UPDATE_COMPUTE_VPOOL:
            auditOp(opType, true, null, computeVpool.getId().toString(), computeVpool.getLabel(), computeVpool.getSystemType(), vArrays.toString());
            break;
        case DELETE_COMPUTE_VPOOL:
            auditOp(opType, true, null, computeVpool.getId().toString(), computeVpool.getLabel(), computeVpool.getSystemType());
            break;
        default:
            _log.error("unrecognized compute vpool operation type");
    }
}
Also used : ComputeVirtualPool(com.emc.storageos.db.client.model.ComputeVirtualPool) ComputeVirtualPoolMapper.toComputeVirtualPool(com.emc.storageos.api.mapper.ComputeVirtualPoolMapper.toComputeVirtualPool)

Example 23 with ComputeVirtualPool

use of com.emc.storageos.db.client.model.ComputeVirtualPool in project coprhd-controller by CoprHD.

the class ComputeVirtualPoolService method getComputeElementsByPool.

/**
 * Get collection of compute elements that match criteria in an existing Compute Virtual Pool
 *
 * @brief Get collection of compute elements that match an existing compute virtual pool
 * @param id The Compute Virtual Pool ID
 * @return ComputeElementListRestRep Collection of Compute Elements
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}/compute-elements")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR }, acls = { ACL.USE })
public ComputeElementListRestRep getComputeElementsByPool(@PathParam("id") URI id) {
    ArgValidator.checkUri(id);
    ComputeVirtualPool cvp = _permissionsHelper.getObjectById(id, ComputeVirtualPool.class);
    ArgValidator.checkEntityNotNull(cvp, id, isIdEmbeddedInURL(id));
    return extractComputeElements(cvp);
}
Also used : ComputeVirtualPool(com.emc.storageos.db.client.model.ComputeVirtualPool) ComputeVirtualPoolMapper.toComputeVirtualPool(com.emc.storageos.api.mapper.ComputeVirtualPoolMapper.toComputeVirtualPool) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

ComputeVirtualPool (com.emc.storageos.db.client.model.ComputeVirtualPool)23 ComputeVirtualPoolMapper.toComputeVirtualPool (com.emc.storageos.api.mapper.ComputeVirtualPoolMapper.toComputeVirtualPool)15 URI (java.net.URI)12 Produces (javax.ws.rs.Produces)12 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)11 Path (javax.ws.rs.Path)11 POST (javax.ws.rs.POST)7 ComputeElement (com.emc.storageos.db.client.model.ComputeElement)6 Consumes (javax.ws.rs.Consumes)6 StringSet (com.emc.storageos.db.client.model.StringSet)4 HashSet (java.util.HashSet)4 ComputeSystem (com.emc.storageos.db.client.model.ComputeSystem)3 Host (com.emc.storageos.db.client.model.Host)3 APIException (com.emc.storageos.svcs.errorhandling.resources.APIException)3 GET (javax.ws.rs.GET)3 PUT (javax.ws.rs.PUT)3 ComputeLanBootImagePath (com.emc.storageos.db.client.model.ComputeLanBootImagePath)2 ComputeSanBootImagePath (com.emc.storageos.db.client.model.ComputeSanBootImagePath)2 TenantOrg (com.emc.storageos.db.client.model.TenantOrg)2 UCSServiceProfileTemplate (com.emc.storageos.db.client.model.UCSServiceProfileTemplate)2