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