Search in sources :

Example 1 with BlockVirtualPoolForm

use of models.virtualpool.BlockVirtualPoolForm in project coprhd-controller by CoprHD.

the class BlockVirtualPools method updateAutoVirtualPool.

private static void updateAutoVirtualPool(String vpid, BlockVirtualPoolRestRep blockvpool, JsonArray vpools) {
    BlockVirtualPoolForm vpool = new BlockVirtualPoolForm();
    vpool.load(blockvpool);
    blockvpool = vpool.save();
    if (blockvpool != null) {
        buildVpoolCookies(vpid, vpool.name, vpools);
    }
}
Also used : BlockVirtualPoolForm(models.virtualpool.BlockVirtualPoolForm)

Example 2 with BlockVirtualPoolForm

use of models.virtualpool.BlockVirtualPoolForm in project coprhd-controller by CoprHD.

the class BlockVirtualPools method edit.

public static void edit(String id) {
    BlockVirtualPoolRestRep virtualPool = VirtualPoolUtils.getBlockVirtualPool(id);
    if (virtualPool == null) {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        backToReferrer();
    }
    BlockVirtualPoolForm vpool = new BlockVirtualPoolForm();
    vpool.load(virtualPool);
    edit(vpool);
}
Also used : BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) BlockVirtualPoolForm(models.virtualpool.BlockVirtualPoolForm)

Example 3 with BlockVirtualPoolForm

use of models.virtualpool.BlockVirtualPoolForm in project coprhd-controller by CoprHD.

the class BlockVirtualPools method create.

public static void create() {
    BlockVirtualPoolForm vpool = new BlockVirtualPoolForm();
    vpool.provisioningType = ProvisioningTypes.THIN;
    vpool.protocols = Sets.newHashSet(BlockProtocols.FC);
    vpool.placementPolicy = VirtualPoolPlacementPolicy.DEFAULT;
    vpool.minPaths = 1;
    vpool.maxPaths = 2;
    vpool.initiatorPaths = 1;
    vpool.expandable = true;
    vpool.rpJournalSizeUnit = SizeUnit.x;
    vpool.rpJournalSize = RPCopyForm.JOURNAL_DEFAULT_MULTIPLIER;
    vpool.rpRpoValue = Long.valueOf(25);
    vpool.rpRpoType = RpoType.SECONDS;
    vpool.protectSourceSite = true;
    vpool.enableAutoCrossConnExport = true;
    edit(vpool);
}
Also used : BlockVirtualPoolForm(models.virtualpool.BlockVirtualPoolForm)

Example 4 with BlockVirtualPoolForm

use of models.virtualpool.BlockVirtualPoolForm 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 5 with BlockVirtualPoolForm

use of models.virtualpool.BlockVirtualPoolForm in project coprhd-controller by CoprHD.

the class BlockVirtualPools method duplicate.

public static void duplicate(String ids) {
    BlockVirtualPoolRestRep targetVPool = VirtualPoolUtils.getBlockVirtualPool(ids);
    if (targetVPool == null) {
        flash.error(MessagesUtils.get(UNKNOWN, ids));
        backToReferrer();
    }
    BlockVirtualPoolForm copy = new BlockVirtualPoolForm();
    copy.load(targetVPool);
    copy.id = null;
    copy.name = Messages.get("virtualPools.duplicate.name", copy.name);
    // Target VPool could have resources, set resources to 0 on the new Copy VPool so user can modify form
    copy.numResources = 0;
    edit(copy);
}
Also used : BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) BlockVirtualPoolForm(models.virtualpool.BlockVirtualPoolForm)

Aggregations

BlockVirtualPoolForm (models.virtualpool.BlockVirtualPoolForm)6 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)4 StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)2 URI (java.net.URI)1 AutoTierPolicyNamesCall (jobs.vipr.AutoTierPolicyNamesCall)1 StoragePoolInfo (models.datatable.StoragePoolDataTable.StoragePoolInfo)1