use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualDataCenters method listJson.
@FlashException(value = "list", keep = true)
public static void listJson() {
List<VirtualDataCenterRestRep> viprVDCs = VirtualDataCenterUtils.listByIds(refIds(VirtualDataCenterUtils.list()));
List<VirtualDataCentersDataTable.VirtualDataCenter> vdcs = Lists.newArrayList();
for (VirtualDataCenterRestRep vdc : viprVDCs) {
if (Security.isSystemAdminOrRestrictedSystemAdmin() || Security.isSecurityAdminOrRestrictedSecurityAdmin() || Security.isSystemMonitor()) {
vdcs.add(new VirtualDataCentersDataTable.VirtualDataCenter(vdc));
}
}
renderJSON(DataTablesSupport.createJSON(vdcs, params));
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualDataCenters method edit.
@FlashException(value = "list", keep = true)
@Restrictions({ @Restrict("SYSTEM_ADMIN"), @Restrict("SECURITY_ADMIN"), @Restrict("RESTRICTED_SECURITY_ADMIN") })
public static void edit(String id) {
VirtualDataCenterRestRep viprVDC = VirtualDataCenterUtils.get(id);
if (viprVDC != null) {
VirtualDataCenterForm vdc = new VirtualDataCenterForm().from(viprVDC);
addRenderArgs();
render(vdc);
} else {
flash.error(MessagesUtils.get("vdcs.unknown", id));
list();
}
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockConsistencyGroups method removeVolume.
@FlashException(referrer = { "consistencyGroupDetails" })
public static void removeVolume(String consistencyGroupId, String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<URI> uris = new ArrayList<URI>();
uris.add(uri(volumeId));
BlockConsistencyGroupUpdate blockConsistencyGroupUpdate = new BlockConsistencyGroupUpdate();
BlockConsistencyGroupVolumeList volumeList = new BlockConsistencyGroupVolumeList();
volumeList.setVolumes(uris);
blockConsistencyGroupUpdate.setRemoveVolumesList(volumeList);
Task<BlockConsistencyGroupRestRep> task = client.blockConsistencyGroups().update(uri(consistencyGroupId), blockConsistencyGroupUpdate);
flash.put("info", MessagesUtils.get("resources.consistencygroup.volume.removed", task.getOpId()));
consistencyGroupDetails(consistencyGroupId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method addClusters.
@FlashException(referrer = { "exportGroup" })
public static void addClusters(String exportId, @As(",") String[] ids) {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setClusters(new ClustersUpdateParam());
if (ids != null && ids.length > 0) {
for (String clusterId : ids) {
exportUpdateParam.getClusters().getAdd().add(uri(clusterId));
}
}
Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.clusters.added", task.getOpId()));
exportGroup(exportId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeCluster.
@FlashException(referrer = { "exportGroup" })
public static void removeCluster(String exportGroupId, String clusterId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setClusters(new ClustersUpdateParam());
exportUpdateParam.getClusters().getRemove().add(uri(clusterId));
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.cluster.removed", task.getOpId()));
exportGroup(exportGroupId);
}
Aggregations