Search in sources :

Example 11 with NetworkRestRep

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));
}
Also used : NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep)

Example 12 with NetworkRestRep

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));
}
Also used : NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep)

Example 13 with NetworkRestRep

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);
}
Also used : NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep)

Example 14 with NetworkRestRep

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);
}
Also used : NetworkCreate(com.emc.storageos.model.varray.NetworkCreate) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep) FlashException(controllers.util.FlashException)

Example 15 with NetworkRestRep

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));
}
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)16 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)4 HashSet (java.util.HashSet)3 EndpointAliasRestRep (com.emc.storageos.model.EndpointAliasRestRep)2 HostRestRep (com.emc.storageos.model.host.HostRestRep)2 InitiatorRestRep (com.emc.storageos.model.host.InitiatorRestRep)2 IpInterfaceRestRep (com.emc.storageos.model.host.IpInterfaceRestRep)2 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 EndpointInfo (models.datatable.NetworkEndpointDataTable.EndpointInfo)2 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 FCEndpoint (com.emc.storageos.db.client.model.FCEndpoint)1 StringSet (com.emc.storageos.db.client.model.StringSet)1 StringHashMapEntry (com.emc.storageos.model.StringHashMapEntry)1 StringMapAdapter (com.emc.storageos.model.adapters.StringMapAdapter)1 NetworkCreate (com.emc.storageos.model.varray.NetworkCreate)1 NetworkEndpointParam (com.emc.storageos.model.varray.NetworkEndpointParam)1 NetworkUpdate (com.emc.storageos.model.varray.NetworkUpdate)1 WebResource (com.sun.jersey.api.client.WebResource)1 FlashException (controllers.util.FlashException)1 URI (java.net.URI)1