use of models.datatable.NetworksDataTable.NetworkInfo in project coprhd-controller by CoprHD.
the class Networks method listJson.
/**
* Retrieves all networks and renders them as JSON for a datatable.
*/
public static void listJson() {
// Creates a mapping of ID => virtual array name
Map<URI, String> virtualArrays = ResourceUtils.mapNames(getViprClient().varrays().list());
List<NetworkInfo> items = Lists.newArrayList();
for (NetworkRestRep network : NetworkUtils.getNetworks()) {
NetworkInfo info = new NetworkInfo(network);
Set<String> varrayNames = getNames(virtualArrays, uris(network.getAssignedVirtualArrays()));
info.virtualArrayNames = StringUtils.join(varrayNames, ",");
items.add(info);
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
Aggregations