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));
}
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));
}
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));
}
Aggregations