use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPoolService method getObjectVirtualPool.
/**
* Get info for Object Store VirtualPool
*
* @param id the URN of a ViPR VirtualPool
* @brief Show Object store VirtualPool
* @return VirtualPool details
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("/{id}")
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR }, acls = { ACL.USE })
public ObjectVirtualPoolRestRep getObjectVirtualPool(@PathParam("id") URI id) {
VirtualPool vpool = getVirtualPool(VirtualPool.Type.object, id);
ObjectVirtualPoolRestRep restRep = toObjectVirtualPool(vpool);
restRep.setNumResources(getNumResources(vpool, _dbClient));
if (null != vpool.getMaxRetention()) {
restRep.setMaxRetention(vpool.getMaxRetention());
}
if (null != vpool.getMinDataCenters()) {
restRep.setMinDataCenters(vpool.getMinDataCenters());
}
return restRep;
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method save.
@FlashException(keep = true, referrer = { "create", "edit" })
public static void save(ObjectVirtualPoolForm vpool) {
if (vpool == null) {
list();
}
if (vpool.objectProtocols != null) {
vpool.protocols = Sets.newHashSet(vpool.objectProtocols);
}
vpool.validate("vpool");
if (Validation.hasErrors()) {
Common.handleError();
}
ObjectVirtualPoolRestRep result = vpool.save();
flash.success(MessagesUtils.get(SAVED_SUCCESS, result.getName()));
backToReferrer();
}
use of com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method listJson.
public static void listJson() {
List<VirtualPoolInfo> items = Lists.newArrayList();
for (ObjectVirtualPoolRestRep virtualPool : VirtualPoolUtils.getObjectVirtualPools()) {
items.add(new VirtualPoolInfo(virtualPool));
}
renderJSON(DataTablesSupport.createJSON(items, params));
}
Aggregations