mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge branch '4.14'
This commit is contained in:
commit
2b220b5624
@ -181,7 +181,7 @@ public class ListUsageRecordsCmd extends BaseListCmd {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
response.setResponses(usageResponses, usageResponses.size());
|
response.setResponses(usageResponses, usageRecords.second());
|
||||||
}
|
}
|
||||||
|
|
||||||
response.setResponseName(getCommandName());
|
response.setResponseName(getCommandName());
|
||||||
|
|||||||
@ -3436,11 +3436,6 @@ public class ApiResponseHelper implements ResponseGenerator {
|
|||||||
if (networkId == null) {
|
if (networkId == null) {
|
||||||
networkId = ip.getSourceNetworkId();
|
networkId = ip.getSourceNetworkId();
|
||||||
}
|
}
|
||||||
NetworkDetailVO networkDetail = networkDetailsDao.findDetail(networkId, Network.hideIpAddressUsage);
|
|
||||||
if (networkDetail != null && networkDetail.getValue() != null && networkDetail.getValue().equals("true")) {
|
|
||||||
// Don't export network usage when admin wants it hidden
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
resourceType = ResourceObjectType.PublicIpAddress;
|
resourceType = ResourceObjectType.PublicIpAddress;
|
||||||
resourceId = ip.getId();
|
resourceId = ip.getId();
|
||||||
usageRecResponse.setUsageId(ip.getUuid());
|
usageRecResponse.setUsageId(ip.getUuid());
|
||||||
|
|||||||
@ -171,7 +171,7 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
|
|
||||||
hostResponse.setMemoryTotal(host.getTotalMemory());
|
hostResponse.setMemoryTotal(host.getTotalMemory());
|
||||||
Float totalMemorywithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
Float totalMemorywithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setMemWithOverprovisioning(totalMemorywithOverprovisioning.toString());
|
hostResponse.setMemWithOverprovisioning(decimalFormat.format(totalMemorywithOverprovisioning));
|
||||||
hostResponse.setMemoryAllocated(mem);
|
hostResponse.setMemoryAllocated(mem);
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
@ -192,7 +192,7 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
|
|
||||||
float cpuWithOverprovisioning = host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId());
|
float cpuWithOverprovisioning = host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setCpuAllocated(calculateResourceAllocatedPercentage(cpu, cpuWithOverprovisioning));
|
hostResponse.setCpuAllocated(calculateResourceAllocatedPercentage(cpu, cpuWithOverprovisioning));
|
||||||
hostResponse.setCpuWithOverprovisioning(Float.toString(cpuWithOverprovisioning));
|
hostResponse.setCpuWithOverprovisioning(decimalFormat.format(cpuWithOverprovisioning));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (details.contains(HostDetails.all) || details.contains(HostDetails.stats)) {
|
if (details.contains(HostDetails.all) || details.contains(HostDetails.stats)) {
|
||||||
@ -320,7 +320,7 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
|
|
||||||
hostResponse.setMemoryTotal(host.getTotalMemory());
|
hostResponse.setMemoryTotal(host.getTotalMemory());
|
||||||
Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
Float memWithOverprovisioning = host.getTotalMemory() * ApiDBUtils.getMemOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setMemWithOverprovisioning(memWithOverprovisioning.toString());
|
hostResponse.setMemWithOverprovisioning(decimalFormat.format(memWithOverprovisioning));
|
||||||
hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
|
hostResponse.setMemoryAllocated(decimalFormat.format((float) mem / memWithOverprovisioning * 100.0f) +"%");
|
||||||
|
|
||||||
String hostTags = host.getTag();
|
String hostTags = host.getTag();
|
||||||
@ -341,7 +341,7 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
|||||||
|
|
||||||
float cpuWithOverprovisioning = host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId());
|
float cpuWithOverprovisioning = host.getCpus() * host.getSpeed() * ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId());
|
||||||
hostResponse.setCpuAllocated(calculateResourceAllocatedPercentage(cpu, cpuWithOverprovisioning));
|
hostResponse.setCpuAllocated(calculateResourceAllocatedPercentage(cpu, cpuWithOverprovisioning));
|
||||||
hostResponse.setCpuWithOverprovisioning(Float.toString(cpuWithOverprovisioning));
|
hostResponse.setCpuWithOverprovisioning(decimalFormat.format(cpuWithOverprovisioning));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (details.contains(HostDetails.all) || details.contains(HostDetails.stats)) {
|
if (details.contains(HostDetails.all) || details.contains(HostDetails.stats)) {
|
||||||
|
|||||||
@ -562,9 +562,9 @@ public class Site2SiteVpnManagerImpl extends ManagerBase implements Site2SiteVpn
|
|||||||
_accountMgr.checkAccess(caller, null, false, conn);
|
_accountMgr.checkAccess(caller, null, false, conn);
|
||||||
|
|
||||||
if (conn.getState() == State.Pending) {
|
if (conn.getState() == State.Pending) {
|
||||||
throw new InvalidParameterValueException("VPN connection " + id + " cannot be reseted when state is Pending!");
|
conn.setState(State.Disconnected);
|
||||||
}
|
}
|
||||||
if (conn.getState() == State.Connected || conn.getState() == State.Error) {
|
if (conn.getState() == State.Connected || conn.getState() == State.Error || conn.getState() == State.Disconnected) {
|
||||||
stopVpnConnection(id);
|
stopVpnConnection(id);
|
||||||
}
|
}
|
||||||
startVpnConnection(id);
|
startVpnConnection(id);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user