From ea64f6838fe23683643a64971689ad4d22eddfe9 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Fri, 15 Mar 2024 08:34:42 +0100 Subject: [PATCH] Update 8756: fix HostMetricsResponse and SystemVmResponse --- .../cloudstack/api/response/SystemVmResponse.java | 8 -------- .../apache/cloudstack/metrics/MetricsServiceImpl.java | 2 +- .../cloudstack/response/HostMetricsResponse.java | 10 ---------- 3 files changed, 1 insertion(+), 19 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java b/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java index 31a8b731491c..c98235b23475 100644 --- a/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java +++ b/api/src/main/java/org/apache/cloudstack/api/response/SystemVmResponse.java @@ -38,14 +38,6 @@ public class SystemVmResponse extends BaseResponseWithAnnotations { @Param(description = "the system VM type") private String systemVmType; - @SerializedName("jobid") - @Param(description = "the job ID associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.") - private String jobId; - - @SerializedName("jobstatus") - @Param(description = "the job status associated with the system VM. This is only displayed if the router listed is part of a currently running asynchronous job.") - private Integer jobStatus; - @SerializedName("zoneid") @Param(description = "the Zone ID for the system VM") private String zoneId; diff --git a/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java b/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java index 0a6e6e8f4fd7..8a36ea12bb58 100644 --- a/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java +++ b/plugins/metrics/src/main/java/org/apache/cloudstack/metrics/MetricsServiceImpl.java @@ -714,7 +714,7 @@ public List listHostMetrics(List hostResponse metricsResponse.setCpuTotal(hostResponse.getCpuNumber(), hostResponse.getCpuSpeed()); metricsResponse.setCpuUsed(hostResponse.getCpuUsed(), hostResponse.getCpuNumber(), hostResponse.getCpuSpeed()); metricsResponse.setCpuAllocated(hostResponse.getCpuAllocated(), hostResponse.getCpuNumber(), hostResponse.getCpuSpeed()); - metricsResponse.setLoadAverage(hostResponse.getAverageLoad()); + metricsResponse.setCpuAverageLoad(hostResponse.getAverageLoad()); metricsResponse.setMemTotal(hostResponse.getMemoryTotal()); metricsResponse.setMemAllocated(hostResponse.getMemoryAllocated()); metricsResponse.setMemUsed(hostResponse.getMemoryUsed()); diff --git a/plugins/metrics/src/main/java/org/apache/cloudstack/response/HostMetricsResponse.java b/plugins/metrics/src/main/java/org/apache/cloudstack/response/HostMetricsResponse.java index 8e12d2cbb6d8..39d759f333f1 100644 --- a/plugins/metrics/src/main/java/org/apache/cloudstack/response/HostMetricsResponse.java +++ b/plugins/metrics/src/main/java/org/apache/cloudstack/response/HostMetricsResponse.java @@ -52,10 +52,6 @@ public class HostMetricsResponse extends HostResponse { @Param(description = "the total cpu allocated in Ghz") private String cpuAllocated; - @SerializedName("cpuloadaverage") - @Param(description = "the average cpu load the last minute") - private Double loadAverage; - @SerializedName("memorytotalgb") @Param(description = "the total memory capacity in GiB") private String memTotal; @@ -132,12 +128,6 @@ public void setCpuUsed(final String cpuUsed, final Integer cpuNumber, final Long } } - public void setLoadAverage(final Double loadAverage) { - if (loadAverage != null) { - this.loadAverage = loadAverage; - } - } - public void setCpuAllocated(final String cpuAllocated, final Integer cpuNumber, final Long cpuSpeed) { if (cpuAllocated != null && cpuNumber != null && cpuSpeed != null) { this.cpuAllocated = String.format("%.2f Ghz", parseCPU(cpuAllocated) * cpuNumber * cpuSpeed / (100.0 * 1000.0));