本文整理了Java中org.ovirt.engine.api.model.Quota.setId
方法的一些代码示例,展示了Quota.setId
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.setId
方法的具体详情如下:
包路径:org.ovirt.engine.api.model.Quota
类名称:Quota
方法名:setId
暂无
代码示例来源:origin: oVirt/ovirt-engine
private Quota getModel() {
Quota quota = new Quota();
quota.setId(GUIDS[0].toString());
quota.setDescription(DESCRIPTIONS[0]);
quota.setClusterHardLimitPct(30);
return quota;
}
代码示例来源:origin: oVirt/ovirt-engine
private static void map(QuotaClusterLimit template,
QuotaCluster quotaCluster,
String clusterId,
String dataCenterId,
String quotaId) {
template.setQuota(new Quota());
template.getQuota().setId(quotaId);
template.getQuota().setDataCenter(new DataCenter());
template.getQuota().getDataCenter().setId(dataCenterId);
if (clusterId != null) {
template.setCluster(new Cluster());
template.getCluster().setId(clusterId);
}
if (quotaCluster.getMemSizeMB() != null) {
// show GB instead of MB (ignore -1)
double value = quotaCluster.getMemSizeMB() == -1 ? quotaCluster.getMemSizeMB().doubleValue()
: quotaCluster.getMemSizeMB().doubleValue() / 1024.0;
template.setMemoryLimit(value);
}
if (quotaCluster.getMemSizeMBUsage() != null) {
template.setMemoryUsage(quotaCluster.getMemSizeMBUsage() / 1024.0);
}
if (quotaCluster.getVirtualCpu() != null) {
template.setVcpuLimit(quotaCluster.getVirtualCpu());
}
if (quotaCluster.getVirtualCpuUsage() != null) {
template.setVcpuUsage(quotaCluster.getVirtualCpuUsage());
}
}
代码示例来源:origin: oVirt/ovirt-engine
private static void map(QuotaStorageLimit model,
QuotaStorage quotaStorage,
String storageDomainId,
String dataCenterId,
String quotaId) {
model.setQuota(new Quota());
model.getQuota().setId(quotaId);
model.getQuota().setDataCenter(new DataCenter());
model.getQuota().getDataCenter().setId(dataCenterId);
if (storageDomainId != null) {
model.setStorageDomain(new StorageDomain());
model.getStorageDomain().setId(storageDomainId);
}
if (quotaStorage.getStorageSizeGB() != null) {
model.setLimit(quotaStorage.getStorageSizeGB());
}
if (quotaStorage.getStorageSizeGBUsage() != null) {
model.setUsage(quotaStorage.getStorageSizeGBUsage());
}
}
代码示例来源:origin: oVirt/ovirt-engine
@Mapping(from = org.ovirt.engine.core.common.businessentities.Quota.class, to = Quota.class)
public static Quota map(org.ovirt.engine.core.common.businessentities.Quota template, Quota model) {
Quota ret = (model==null) ? new Quota() : model;
if (template.getId()!=null) {
ret.setId(template.getId().toString());
}
if (template.getQuotaName()!=null) {
ret.setName(template.getQuotaName());
}
if (template.getDescription()!=null) {
ret.setDescription(template.getDescription());
}
if (template.getStoragePoolId()!=null) {
if (ret.getDataCenter()==null) {
ret.setDataCenter(new DataCenter());
}
ret.getDataCenter().setId(template.getStoragePoolId().toString());
}
ret.setClusterHardLimitPct(template.getGraceClusterPercentage());
ret.setStorageHardLimitPct(template.getGraceStoragePercentage());
ret.setClusterSoftLimitPct(template.getThresholdClusterPercentage());
ret.setStorageSoftLimitPct(template.getThresholdStoragePercentage());
return ret;
}
代码示例来源:origin: oVirt/ovirt-engine
to.setId(from.getId());
代码示例来源:origin: oVirt/ovirt-engine
quota.setId(entity.getQuotaId().toString());
代码示例来源:origin: oVirt/ovirt-engine
quota.setId(entity.getQuotaId().toString());
model.setQuota(quota);
内容来源于网络,如有侵权,请联系作者删除!