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);
}
}
}
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");
}
}
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);
}
Aggregations