use of com.emc.storageos.model.block.export.InitiatorsUpdateParam in project coprhd-controller by CoprHD.
the class BlockExportGroups method removeInitiator.
@FlashException(referrer = { "exportGroup" })
public static void removeInitiator(String exportGroupId, String initiatorId) {
ViPRCoreClient client = BourneUtil.getViprClient();
ExportUpdateParam exportUpdateParam = new ExportUpdateParam();
exportUpdateParam.setInitiators(new InitiatorsUpdateParam());
Set<URI> remove = Sets.newHashSet();
remove.add(uri(initiatorId));
exportUpdateParam.getInitiators().setRemove(remove);
Task<ExportGroupRestRep> task = client.blockExports().update(uri(exportGroupId), exportUpdateParam);
flash.put("info", MessagesUtils.get("resources.exportgroup.initiator.removed", task.getOpId()));
exportGroup(exportGroupId);
}
use of com.emc.storageos.model.block.export.InitiatorsUpdateParam 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);
}
Aggregations