Search in sources :

Example 6 with StoragePoolInfo

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));
}
Also used : StoragePoolInfo(models.datatable.StoragePoolDataTable.StoragePoolInfo) BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) URI(java.net.URI) BlockVirtualPoolForm(models.virtualpool.BlockVirtualPoolForm)

Example 7 with StoragePoolInfo

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));
}
Also used : StoragePoolInfo(models.datatable.StoragePoolDataTable.StoragePoolInfo) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) URI(java.net.URI)

Aggregations

StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)7 StoragePoolInfo (models.datatable.StoragePoolDataTable.StoragePoolInfo)7 URI (java.net.URI)4 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)1 BlockVirtualPoolForm (models.virtualpool.BlockVirtualPoolForm)1