use of com.emc.vipr.client.exceptions.ViPRException in project coprhd-controller by CoprHD.
the class BlockVirtualPools method save.
public static void save(BlockVirtualPoolForm vpool) {
if (vpool == null) {
list();
}
vpool.deserialize();
vpool.validate("vpool");
if (Validation.hasErrors()) {
error(vpool);
}
try {
BlockVirtualPoolRestRep virtualPool = vpool.save();
flash.success(MessagesUtils.get(SAVED_SUCCESS, virtualPool.getName()));
list();
} catch (ViPRException e) {
exception(vpool, e);
}
}
use of com.emc.vipr.client.exceptions.ViPRException in project coprhd-controller by CoprHD.
the class ComputeVirtualPools method saveTenantACLs.
/**
* Saves tenant ACLs on the virtual compute pool.
*
* @param vpoolId
* the virtual compute pool ID.
* @param tenants
* the tenant ACLs.
* @param enableTenants
* the checked status for "Grant Access to Tenants".
*/
private static void saveTenantACLs(String vpoolId, List<String> tenants, Boolean enableTenants) {
Set<String> tenantIds = Sets.newHashSet();
if (isTrue(enableTenants) && tenants != null) {
tenantIds.addAll(tenants);
}
ACLUpdateBuilder builder = new ACLUpdateBuilder(ComputeVirtualPoolUtils.getComputeACLs(vpoolId));
builder.setTenants(tenantIds);
try {
ComputeVirtualPoolUtils.updateComputeACLs(vpoolId, builder.getACLUpdate());
} catch (ViPRException e) {
Logger.error(e, "Failed to update Compute Virtual Pool ACLs");
String errorDesc = e.getMessage();
if (e instanceof ServiceErrorException) {
errorDesc = ((ServiceErrorException) e).getDetailedMessage();
}
flash.error(MessagesUtils.get("computeVirtualPool.updateComputeVirtualPoolACLs.failed", errorDesc));
}
}
Aggregations