Search in sources :

Example 1 with NetworkInfo

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));
}
Also used : NetworkInfo(models.datatable.NetworksDataTable.NetworkInfo) URI(java.net.URI) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep)

Aggregations

NetworkRestRep (com.emc.storageos.model.varray.NetworkRestRep)1 URI (java.net.URI)1 NetworkInfo (models.datatable.NetworksDataTable.NetworkInfo)1