use of com.emc.storageos.model.varray.NetworkRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method availableNetworksJson.
/**
* Renders the list of networks available to add to the given virtual array as JSON.
*
* @param id
* the virtual array ID.
*/
public static void availableNetworksJson(String id) {
List<NetworkInfo> items = Lists.newArrayList();
List<NetworkRestRep> networks = NetworkUtils.getNetworksAssignableToVirtualArray(id);
for (NetworkRestRep network : networks) {
items.add(new NetworkInfo(network, id));
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
use of com.emc.storageos.model.varray.NetworkRestRep in project coprhd-controller by CoprHD.
the class VirtualArrays method networksJson.
/**
* Renders the list of networks for a given virtual array as JSON.
*
* @param id
* the virtual array ID.
*/
public static void networksJson(String id) {
List<NetworkInfo> items = Lists.newArrayList();
List<NetworkRestRep> networks = NetworkUtils.getNetworksByVirtualArray(id);
for (NetworkRestRep network : networks) {
items.add(new NetworkInfo(network, id));
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
use of com.emc.storageos.model.varray.NetworkRestRep in project coprhd-controller by CoprHD.
the class Networks method edit.
/**
* Displays a page for editing the given network.
*
* @param id
* the network ID.
* @param virtualArrayId
* the virtual array from which the edit request came.
*/
public static void edit(String id, String virtualArrayId) {
NetworkRestRep network = getNetwork(id);
NetworkForm form = new NetworkForm();
form.load(network);
edit(form);
}
use of com.emc.storageos.model.varray.NetworkRestRep in project coprhd-controller by CoprHD.
the class Networks method createIpNetwork.
@FlashException("list")
public static void createIpNetwork(String name, String virtualArrayId) {
NetworkCreate param = new NetworkCreate();
param.setLabel(name);
param.setTransportType(TransportProtocols.IP);
if (StringUtils.isNotBlank(virtualArrayId)) {
param.setVarrays(uris(virtualArrayId));
}
NetworkRestRep network = NetworkUtils.create(param);
edit(stringId(network), virtualArrayId);
}
use of com.emc.storageos.model.varray.NetworkRestRep 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