use of models.datatable.StoragePoolDataTable.StoragePoolInfo in project coprhd-controller by CoprHD.
the class BlockVirtualPools method listStoragePoolsbyIdJson.
public static void listStoragePoolsbyIdJson(String id) {
BlockVirtualPoolRestRep virtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
if (virtualPool == null) {
flash.error(MessagesUtils.get(UNKNOWN, id));
backToReferrer();
}
BlockVirtualPoolForm vpool = new BlockVirtualPoolForm();
vpool.load(virtualPool);
List<StoragePoolInfo> items = Lists.newArrayList();
if (vpool != null && vpool.protocols != null && !vpool.protocols.isEmpty()) {
vpool.deserialize();
Map<URI, String> storageSystemNames = StorageSystemUtils.getStorageSystemNames();
List<StoragePoolRestRep> pools = getMatchingStoragePools(vpool);
for (StoragePoolRestRep pool : pools) {
String storageSystemName = storageSystemNames.get(id(pool.getStorageSystem()));
items.add(new StoragePoolInfo(pool, storageSystemName));
}
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
use of models.datatable.StoragePoolDataTable.StoragePoolInfo in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method listStoragePoolsJson.
public static void listStoragePoolsJson(ObjectVirtualPoolForm vpool) {
List<StoragePoolInfo> items = Lists.newArrayList();
if (vpool.objectProtocols != null) {
vpool.protocols = Sets.newHashSet(vpool.objectProtocols);
}
if (vpool != null && vpool.protocols != null && !vpool.protocols.isEmpty()) {
Map<URI, String> storageSystemNames = StorageSystemUtils.getStorageSystemNames();
List<StoragePoolRestRep> pools = getMatchingStoragePools(vpool);
for (StoragePoolRestRep pool : pools) {
String storageSystemName = storageSystemNames.get(id(pool.getStorageSystem()));
items.add(new StoragePoolInfo(pool, storageSystemName));
}
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
Aggregations