use of com.emc.storageos.model.vpool.BlockVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPoolService method getVirtualPool.
/**
* Get info for block store virtual pool
*
* @prereq none
* @param id the URN of a ViPR VirtualPool
* @brief Show block store virtual pool
* @return VirtualPool details
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR }, acls = { ACL.USE })
public BlockVirtualPoolRestRep getVirtualPool(@PathParam("id") URI id) {
VirtualPool vpool = getVirtualPool(VirtualPool.Type.block, id);
BlockVirtualPoolRestRep restRep = getBlockVirtualPoolWithProtection(vpool);
restRep.setNumResources(getNumResources(vpool, _dbClient));
return restRep;
}
use of com.emc.storageos.model.vpool.BlockVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPoolForm method doSave.
protected BlockVirtualPoolRestRep doSave() {
BlockVirtualPoolRestRep virtualPool;
if (isNew()) {
BlockVirtualPoolBuilder builder = apply(new BlockVirtualPoolBuilder());
virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
this.id = ResourceUtils.stringId(virtualPool);
} else {
BlockVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
BlockVirtualPoolUpdateBuilder builder = apply(new BlockVirtualPoolUpdateBuilder(oldVirtualPool));
virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
Logger.info("Refreshed Block Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
}
virtualPool = saveStoragePools(virtualPool);
return virtualPool;
}
use of com.emc.storageos.model.vpool.BlockVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPoolForm method save.
@Override
public BlockVirtualPoolRestRep save() {
BlockVirtualPoolRestRep virtualPool = doSave();
BlockVirtualPools vpools = getViprClient().blockVpools();
saveQuota(vpools);
saveTenantACLs(vpools);
return virtualPool;
}
use of com.emc.storageos.model.vpool.BlockVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPools method edit.
public static void edit(String id) {
BlockVirtualPoolRestRep virtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
if (virtualPool == null) {
flash.error(MessagesUtils.get(UNKNOWN, id));
backToReferrer();
}
BlockVirtualPoolForm vpool = new BlockVirtualPoolForm();
vpool.load(virtualPool);
edit(vpool);
}
use of com.emc.storageos.model.vpool.BlockVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class BlockVirtualPools method checkDisconnectedStoragePools.
public static void checkDisconnectedStoragePools(@As(",") String[] ids) {
List<BlockVirtualPoolRestRep> virtualpools = VirtualPoolUtils.getBlockVirtualPools();
Set<String> connectedstoragepools = new HashSet<String>();
List<String> failedArrays = new ArrayList<String>();
for (BlockVirtualPoolRestRep virtualpool : virtualpools) {
if (virtualpool.getUseMatchedPools()) {
for (RelatedResourceRep pool : virtualpool.getMatchedStoragePools()) {
connectedstoragepools.add(pool.getId().toString());
}
} else {
for (RelatedResourceRep pool : virtualpool.getAssignedStoragePools()) {
connectedstoragepools.add(pool.getId().toString());
}
}
}
for (String id : ids) {
StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
if (storageSystem != null && !storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
boolean found = false;
List<StoragePoolRestRep> storagepools = StoragePoolUtils.getStoragePools(id);
for (StoragePoolRestRep storagepool : storagepools) {
if (connectedstoragepools.contains(storagepool.getId().toString())) {
found = true;
break;
}
}
if (!found) {
failedArrays.add(storageSystem.getName());
}
}
}
renderJSON(failedArrays);
}
Aggregations