use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method addInitiators.
@FlashException(referrer = { "exportGroup" })
public static void addInitiators(String exportId, @As(",") String[] ids) {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setInitiators(new InitiatorsUpdateParam());
if (ids != null && ids.length > 0) {
for (String initiatorId : ids) {
exportUpdateParam.getInitiators().getAdd().add(uri(initiatorId));
}
}
Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.initiators.added", task.getOpId()));
exportGroup(exportId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeHost.
@FlashException(referrer = { "exportGroup" })
public static void removeHost(String exportGroupId, String hostId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setHosts(new HostsUpdateParam());
exportUpdateParam.getHosts().getRemove().add(uri(hostId));
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.host.removed", task.getOpId()));
exportGroup(exportGroupId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeVolume.
@FlashException(referrer = { "exportGroup" })
public static void removeVolume(String exportGroupId, String volumeId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.removeVolume(uri(volumeId));
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.volume.removed", task.getOpId()));
exportGroup(exportGroupId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method deleteExportGroup.
@FlashException(referrer = { "exportGroup" })
public static void deleteExportGroup(String exportGroupId) {
if (StringUtils.isNotBlank(exportGroupId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
Task<ExportGroupRestRep> task = client.blockExports().deactivate(uri(exportGroupId));
flash.put("info", MessagesUtils.get("resources.exportgroup.deactivate"));
}
exportGroup(exportGroupId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockExportGroups method addHosts.
@FlashException(referrer = { "exportGroup" })
public static void addHosts(String exportId, @As(",") String[] ids) {
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setHosts(new HostsUpdateParam());
if (ids != null && ids.length > 0) {
for (String hostId : ids) {
exportUpdateParam.getHosts().getAdd().add(uri(hostId));
}
}
Task<ExportGroupRestRep> task = getViprClient().blockExports().update(uri(exportId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.hosts.added", task.getOpId()));
exportGroup(exportId);
}
Aggregations