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