Search in sources :

Example 6 with StoragePoolRestRep

use of com.emc.storageos.model.pools.StoragePoolRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method savePool.

@FlashException(keep = true, referrer = { "editPool" })
public static void savePool(StorageArrayPoolForm storageArrayPool) {
    storageArrayPool.validate("storageArrayPool");
    if (Validation.hasErrors()) {
        Common.handleError();
    }
    StoragePoolRestRep pool = storageArrayPool.save();
    flash.success(MessagesUtils.get(SAVED_POOL, pool.getPoolName()));
    pools(stringId(pool.getStorageSystem()));
}
Also used : StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) FlashException(controllers.util.FlashException)

Example 7 with StoragePoolRestRep

use of com.emc.storageos.model.pools.StoragePoolRestRep in project coprhd-controller by CoprHD.

the class StoragePoolUtils method getStoragePoolsAssignableToVirtualArray.

public static List<StoragePoolRestRep> getStoragePoolsAssignableToVirtualArray(String virtualArrayId) {
    List<StoragePoolRestRep> assignedPools = getStoragePoolsAssignedToVirtualArray(virtualArrayId);
    List<URI> ids = Lists.newArrayList();
    for (StoragePoolRestRep pool : assignedPools) {
        if ((pool.getAssignedVirtualArrays() != null) && pool.getAssignedVirtualArrays().contains(virtualArrayId)) {
            ids.add(id(pool));
        }
    }
    return getViprClient().storagePools().getAll(new IdFilter<StoragePoolRestRep>(ids).notId());
}
Also used : IdFilter(com.emc.vipr.client.core.filters.IdFilter) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) URI(java.net.URI)

Example 8 with StoragePoolRestRep

use of com.emc.storageos.model.pools.StoragePoolRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method updateStoragePools.

/**
 * Updates the given storage pools with the virtual array assignment changes.
 *
 * @param ids
 *            the storage pool IDs.
 * @param changes
 *            the virtual array changes.
 */
private static void updateStoragePools(List<URI> ids, VirtualArrayAssignmentChanges changes) {
    if (ids.isEmpty()) {
        return;
    }
    List<StoragePoolRestRep> storagePools = StoragePoolUtils.getStoragePools(ids);
    for (StoragePoolRestRep storagePool : storagePools) {
        StoragePoolUpdate update = new StoragePoolUpdate();
        update.setVarrayChanges(changes);
        StoragePoolUtils.update(storagePool.getId(), update);
    }
}
Also used : StoragePoolUpdate(com.emc.storageos.model.pools.StoragePoolUpdate) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep)

Example 9 with StoragePoolRestRep

use of com.emc.storageos.model.pools.StoragePoolRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method availableStoragePoolsJson.

/**
 * Renders the list of storage pools available for the given virtual array as JSON.
 *
 * @param id
 *            the virtual array ID.
 */
public static void availableStoragePoolsJson(String id) {
    List<StoragePoolInfo> items = Lists.newArrayList();
    CachedResources<StorageSystemRestRep> storageSystems = StorageSystemUtils.createCache();
    for (StoragePoolRestRep storagePool : StoragePoolUtils.getStoragePoolsAssignableToVirtualArray(id)) {
        items.add(new StoragePoolInfo(storagePool, storageSystems));
    }
    renderJSON(DataTablesSupport.createJSON(items, params));
}
Also used : StoragePoolInfo(models.datatable.StoragePoolDataTable.StoragePoolInfo) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep)

Example 10 with StoragePoolRestRep

use of com.emc.storageos.model.pools.StoragePoolRestRep in project coprhd-controller by CoprHD.

the class BlockVirtualPools method listStoragePoolsJson.

public static void listStoragePoolsJson(BlockVirtualPoolForm vpool) {
    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) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) URI(java.net.URI)

Aggregations

StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)17 StoragePoolInfo (models.datatable.StoragePoolDataTable.StoragePoolInfo)7 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)5 URI (java.net.URI)5 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)3 StoragePool (com.emc.storageos.db.client.model.StoragePool)2 BlockVirtualPoolForm (models.virtualpool.BlockVirtualPoolForm)2 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)1 StringMapAdapter (com.emc.storageos.model.adapters.StringMapAdapter)1 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)1 StoragePoolBulkRep (com.emc.storageos.model.pools.StoragePoolBulkRep)1 StoragePoolUpdate (com.emc.storageos.model.pools.StoragePoolUpdate)1 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)1 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)1 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 Task (com.emc.vipr.client.Task)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1 IdFilter (com.emc.vipr.client.core.filters.IdFilter)1 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)1