Search in sources :

Example 6 with ObjectVirtualPoolRestRep

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;
}
Also used : ObjectVirtualPoolRestRep(com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep) VirtualPoolMapper.toObjectVirtualPool(com.emc.storageos.api.mapper.VirtualPoolMapper.toObjectVirtualPool) MapObjectVirtualPool(com.emc.storageos.api.mapper.functions.MapObjectVirtualPool) VirtualPool(com.emc.storageos.db.client.model.VirtualPool) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 7 with ObjectVirtualPoolRestRep

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();
}
Also used : ObjectVirtualPoolRestRep(com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep) FlashException(controllers.util.FlashException)

Example 8 with ObjectVirtualPoolRestRep

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));
}
Also used : ObjectVirtualPoolRestRep(com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep) VirtualPoolInfo(models.datatable.VirtualPoolDataTable.VirtualPoolInfo)

Aggregations

ObjectVirtualPoolRestRep (com.emc.storageos.model.vpool.ObjectVirtualPoolRestRep)8 ObjectVirtualPoolForm (models.virtualpool.ObjectVirtualPoolForm)2 Asset (com.emc.sa.asset.annotation.Asset)1 VirtualPoolMapper.toObjectVirtualPool (com.emc.storageos.api.mapper.VirtualPoolMapper.toObjectVirtualPool)1 MapObjectVirtualPool (com.emc.storageos.api.mapper.functions.MapObjectVirtualPool)1 VirtualPool (com.emc.storageos.db.client.model.VirtualPool)1 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)1 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)1 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)1 ObjectVirtualPools (com.emc.vipr.client.core.ObjectVirtualPools)1 FlashException (controllers.util.FlashException)1 URI (java.net.URI)1 HashSet (java.util.HashSet)1 GET (javax.ws.rs.GET)1 Path (javax.ws.rs.Path)1 Produces (javax.ws.rs.Produces)1 VirtualPoolInfo (models.datatable.VirtualPoolDataTable.VirtualPoolInfo)1 ObjectVirtualPoolBuilder (util.builders.ObjectVirtualPoolBuilder)1 ObjectVirtualPoolUpdateBuilder (util.builders.ObjectVirtualPoolUpdateBuilder)1