Search in sources :

Example 1 with StoragePortInfo

use of models.datatable.StoragePortDataTable.StoragePortInfo in project coprhd-controller by CoprHD.

the class StorageSystems method arrayPortsJson.

public static void arrayPortsJson(String id) {
    List<StoragePortInfo> results = Lists.newArrayList();
    List<StoragePortRestRep> storagePorts = StoragePortUtils.getStoragePorts(id);
    for (StoragePortRestRep storagePort : storagePorts) {
        results.add(new StoragePortInfo(storagePort));
    }
    renderJSON(DataTablesSupport.createJSON(results, params));
}
Also used : StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) StoragePortInfo(models.datatable.StoragePortDataTable.StoragePortInfo)

Example 2 with StoragePortInfo

use of models.datatable.StoragePortDataTable.StoragePortInfo in project coprhd-controller by CoprHD.

the class VirtualArrays method storagePortsJson.

/**
 * Renders the list of storage ports for a given virtual array as JSON.
 *
 * @param id
 *            the virtual array ID.
 */
public static void storagePortsJson(String id) {
    List<StoragePortInfo> items = Lists.newArrayList();
    CachedResources<StorageSystemRestRep> storageSystems = StorageSystemUtils.createCache();
    List<StoragePortRestRep> storagePorts = StoragePortUtils.getStoragePortsByVirtualArray(uri(id));
    Map<URI, String> networks = NetworkUtils.getNetworkNamesByVirtualArray(id);
    for (StoragePortRestRep storagePort : storagePorts) {
        StoragePortInfo item = new StoragePortInfo(storagePort, storageSystems.get(storagePort.getStorageDevice()));
        item.assigned = VirtualArrayUtils.isAssigned(storagePort, id);
        item.network = networks.get(id(storagePort.getNetwork()));
        items.add(item);
    }
    renderJSON(DataTablesSupport.createJSON(items, params));
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) StoragePortInfo(models.datatable.StoragePortDataTable.StoragePortInfo) URI(java.net.URI)

Example 3 with StoragePortInfo

use of models.datatable.StoragePortDataTable.StoragePortInfo in project coprhd-controller by CoprHD.

the class VirtualArrays method availableStoragePortsJson.

/**
 * Renders the list of storage ports that are available to be assigned to the given virtual array.
 *
 * @param id
 *            the virtual array ID.
 */
public static void availableStoragePortsJson(String id) {
    List<StoragePortInfo> items = Lists.newArrayList();
    CachedResources<StorageSystemRestRep> storageSystems = StorageSystemUtils.createCache();
    Map<URI, String> networks = NetworkUtils.getNetworkNames();
    List<StoragePortRestRep> storagePorts = StoragePortUtils.getStoragePortsAssignableToVirtualArray(uri(id));
    for (StoragePortRestRep storagePort : storagePorts) {
        StoragePortInfo item = new StoragePortInfo(storagePort, storageSystems.get(storagePort.getStorageDevice()));
        item.network = networks.get(id(storagePort.getNetwork()));
        items.add(item);
    }
    renderJSON(DataTablesSupport.createJSON(items, params));
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) StoragePortInfo(models.datatable.StoragePortDataTable.StoragePortInfo) URI(java.net.URI)

Aggregations

StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)3 StoragePortInfo (models.datatable.StoragePortDataTable.StoragePortInfo)3 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 URI (java.net.URI)2