Search in sources :

Example 1 with BlockVirtualPoolBuilder

use of util.builders.BlockVirtualPoolBuilder in project coprhd-controller by CoprHD.

the class BlockVirtualPoolForm method doSave.

protected BlockVirtualPoolRestRep doSave() {
    BlockVirtualPoolRestRep virtualPool;
    if (isNew()) {
        BlockVirtualPoolBuilder builder = apply(new BlockVirtualPoolBuilder());
        virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
        this.id = ResourceUtils.stringId(virtualPool);
    } else {
        BlockVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
        BlockVirtualPoolUpdateBuilder builder = apply(new BlockVirtualPoolUpdateBuilder(oldVirtualPool));
        virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
        List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
        Logger.info("Refreshed Block Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
    }
    virtualPool = saveStoragePools(virtualPool);
    return virtualPool;
}
Also used : BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) BlockVirtualPoolUpdateBuilder(util.builders.BlockVirtualPoolUpdateBuilder) BlockVirtualPoolBuilder(util.builders.BlockVirtualPoolBuilder)

Example 2 with BlockVirtualPoolBuilder

use of util.builders.BlockVirtualPoolBuilder in project coprhd-controller by CoprHD.

the class BlockVirtualPoolForm method matchingStoragePools.

public MatchingBlockStoragePoolsCall matchingStoragePools() {
    BlockVirtualPoolBuilder builder = new BlockVirtualPoolBuilder();
    apply(builder);
    builder.setUseMatchedPools(true);
    BlockVirtualPoolParam myvpool = builder.getVirtualPool();
    return new MatchingBlockStoragePoolsCall(myvpool);
}
Also used : MatchingBlockStoragePoolsCall(jobs.vipr.MatchingBlockStoragePoolsCall) BlockVirtualPoolParam(com.emc.storageos.model.vpool.BlockVirtualPoolParam) BlockVirtualPoolBuilder(util.builders.BlockVirtualPoolBuilder)

Aggregations

BlockVirtualPoolBuilder (util.builders.BlockVirtualPoolBuilder)2 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 BlockVirtualPoolParam (com.emc.storageos.model.vpool.BlockVirtualPoolParam)1 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)1 MatchingBlockStoragePoolsCall (jobs.vipr.MatchingBlockStoragePoolsCall)1 BlockVirtualPoolUpdateBuilder (util.builders.BlockVirtualPoolUpdateBuilder)1