use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method edit.
public static void edit(String id) {
ObjectVirtualPoolRestRep virtualPool = VirtualPoolUtils.getObjectVirtualPool(id);
if (virtualPool == null) {
flash.error(MessagesUtils.get(UNKNOWN, id));
backToReferrer();
}
ObjectVirtualPoolForm form = new ObjectVirtualPoolForm();
form.load(virtualPool);
edit(form);
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method duplicate.
public static void duplicate(String ids) {
ObjectVirtualPoolRestRep targetVPool = VirtualPoolUtils.getObjectVirtualPool(ids);
if (targetVPool == null) {
flash.error(MessagesUtils.get(UNKNOWN, ids));
backToReferrer();
}
ObjectVirtualPoolForm copy = new ObjectVirtualPoolForm();
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);
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPoolForm method save.
@Override
public ObjectVirtualPoolRestRep save() {
ObjectVirtualPoolRestRep virtualPool = doSave();
ObjectVirtualPools vpools = getViprClient().objectVpools();
saveTenantACLs(vpools);
return virtualPool;
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class VirtualArrayProvider method getObjectVirtualArrays.
@Asset("objectVirtualArray")
public List<AssetOption> getObjectVirtualArrays(AssetOptionsContext context) {
ViPRCoreClient client = api(context);
// Get the set of virtual arrays that are associated with object vpools
Set<URI> varrayIds = new HashSet<>();
for (ObjectVirtualPoolRestRep vpool : client.objectVpools().getByTenant(context.getTenant())) {
varrayIds.addAll(ResourceUtils.refIds(vpool.getVirtualArrays()));
}
filterByContextTenant(varrayIds, client.varrays().getByTenant(context.getTenant()));
return createBaseResourceOptions(client.varrays().getByIds(varrayIds));
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPoolForm method doSave.
protected ObjectVirtualPoolRestRep doSave() {
ObjectVirtualPoolRestRep virtualPool;
if (isNew()) {
ObjectVirtualPoolBuilder builder = apply(new ObjectVirtualPoolBuilder());
virtualPool = VirtualPoolUtils.create(builder.getVirtualPool());
this.id = ResourceUtils.stringId(virtualPool);
} else {
ObjectVirtualPoolRestRep oldVirtualPool = VirtualPoolUtils.getObjectVirtualPool(id);
ObjectVirtualPoolUpdateBuilder builder = apply(new ObjectVirtualPoolUpdateBuilder(oldVirtualPool));
virtualPool = VirtualPoolUtils.update(id, builder.getVirtualPoolUpdate());
List<NamedRelatedResourceRep> matchingPools = VirtualPoolUtils.refreshMatchingPools(virtualPool);
Logger.info("Refreshed File Virtual Pool '%s' matching pools: %d", virtualPool.getName(), matchingPools.size());
}
virtualPool = saveStoragePools(virtualPool);
return virtualPool;
}
Aggregations