Search in sources :

Example 6 with QuotaInfo

use of com.emc.storageos.model.quota.QuotaInfo in project coprhd-controller by CoprHD.

the class VirtualPoolService method getQuota.

protected QuotaInfo getQuota(VirtualPool vpool) {
    QuotaInfo quotaInfo = new QuotaInfo();
    double capacity = CapacityUtils.getVirtualPoolCapacity(_dbClient, vpool.getId(), VirtualPool.Type.lookup(vpool.getType()));
    quotaInfo.setQuotaInGb(vpool.getQuota());
    quotaInfo.setEnabled(vpool.getQuotaEnabled());
    quotaInfo.setCurrentCapacityInGb((long) Math.ceil(capacity / CapacityUtils.GB));
    quotaInfo.setLimitedResource(DbObjectMapper.toNamedRelatedResource(vpool));
    return quotaInfo;
}
Also used : QuotaInfo(com.emc.storageos.model.quota.QuotaInfo)

Example 7 with QuotaInfo

use of com.emc.storageos.model.quota.QuotaInfo in project coprhd-controller by CoprHD.

the class Tenants method edit.

@FlashException("list")
public static void edit(String id) {
    TenantOrgRestRep viprTenant = TenantUtils.getTenant(id);
    if (viprTenant == null) {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
    QuotaInfo quota = TenantUtils.getQuota(id);
    if (viprTenant != null) {
        TenantForm tenant = new TenantForm().from(viprTenant, quota);
        tenant.usermapping = UserMappingForm.loadUserMappingForms(viprTenant.getUserMappings());
        addRenderArgs(tenant);
        // namespace entries
        List<StringOption> allNamespace = TenantUtils.getUnmappedNamespace();
        allNamespace.add(new StringOption(viprTenant.getNamespace(), viprTenant.getNamespace()));
        renderArgs.put("namespaceOptions", allNamespace);
        render(tenant);
    } else {
        flash.error(MessagesUtils.get("tenants.unknown", id));
        list();
    }
}
Also used : QuotaInfo(com.emc.storageos.model.quota.QuotaInfo) FlashException(controllers.util.FlashException)

Aggregations

QuotaInfo (com.emc.storageos.model.quota.QuotaInfo)7 FlashException (controllers.util.FlashException)2 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)1 QuotaUpdateParam (com.emc.storageos.model.quota.QuotaUpdateParam)1 URI (java.net.URI)1 Test (org.junit.Test)1