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