mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
api: metrics API response is not super-set of resources response keys (#3834)
The metrics API has few properties missing that are present in the corresponding resource. Fixes #3831 Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> Co-authored-by: Rohit Yadav <rohit@apache.org>
This commit is contained in:
parent
521217c852
commit
1c130a5dd4
@ -21,14 +21,13 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
|
||||
import com.cloud.org.Cluster;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@EntityReference(value = Cluster.class)
|
||||
public class ClusterResponse extends BaseResponse {
|
||||
@ -216,4 +215,8 @@ public class ClusterResponse extends BaseResponse {
|
||||
resourceDetails.remove("password");
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> getResourceDetails() {
|
||||
return resourceDetails;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,21 +16,22 @@
|
||||
// under the License.
|
||||
package org.apache.cloudstack.api.response;
|
||||
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.cloudstack.api.ApiConstants;
|
||||
import org.apache.cloudstack.api.BaseResponse;
|
||||
import org.apache.cloudstack.api.EntityReference;
|
||||
import org.apache.cloudstack.ha.HAConfig;
|
||||
import org.apache.cloudstack.outofbandmanagement.OutOfBandManagement;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.cloud.host.Host;
|
||||
import com.cloud.host.Status;
|
||||
import com.cloud.hypervisor.Hypervisor.HypervisorType;
|
||||
import com.cloud.serializer.Param;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@EntityReference(value = Host.class)
|
||||
public class HostResponse extends BaseResponse {
|
||||
@ -243,11 +244,6 @@ public class HostResponse extends BaseResponse {
|
||||
@Param(description = "the admin that annotated this host", since = "4.11")
|
||||
private String username;
|
||||
|
||||
// Default visibility to support accessing the details from unit tests
|
||||
Map getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getObjectId() {
|
||||
return this.getId();
|
||||
@ -361,7 +357,7 @@ public class HostResponse extends BaseResponse {
|
||||
this.memoryUsed = memoryUsed;
|
||||
}
|
||||
|
||||
public void setGpuGroups(List<GpuResponse> gpuGroup) {
|
||||
public void setGpuGroup(List<GpuResponse> gpuGroup) {
|
||||
this.gpuGroup = gpuGroup;
|
||||
}
|
||||
|
||||
@ -437,6 +433,10 @@ public class HostResponse extends BaseResponse {
|
||||
this.hostHAResponse = new HostHAResponse(config);
|
||||
}
|
||||
|
||||
public void setHostHAResponse(HostHAResponse hostHAResponse) {
|
||||
this.hostHAResponse = hostHAResponse;
|
||||
}
|
||||
|
||||
public OutOfBandManagementResponse getOutOfBandManagementResponse() {
|
||||
return outOfBandManagementResponse;
|
||||
}
|
||||
@ -445,6 +445,10 @@ public class HostResponse extends BaseResponse {
|
||||
this.outOfBandManagementResponse = new OutOfBandManagementResponse(outOfBandManagementConfig);
|
||||
}
|
||||
|
||||
public void setOutOfBandManagementResponse(OutOfBandManagementResponse outOfBandManagementResponse) {
|
||||
this.outOfBandManagementResponse = outOfBandManagementResponse;
|
||||
}
|
||||
|
||||
public String getResourceState() {
|
||||
return resourceState;
|
||||
}
|
||||
@ -496,7 +500,10 @@ public class HostResponse extends BaseResponse {
|
||||
detailsCopy.remove("password");
|
||||
|
||||
this.details = detailsCopy;
|
||||
}
|
||||
|
||||
public Map getDetails() {
|
||||
return details;
|
||||
}
|
||||
|
||||
public void setMemoryTotal(Long memoryTotal) {
|
||||
|
||||
@ -262,19 +262,19 @@ public class VolumeResponse extends BaseResponseWithTagInformation implements Co
|
||||
|
||||
@SerializedName(ApiConstants.CLUSTER_ID)
|
||||
@Param(description = "cluster id of the volume")
|
||||
private String clusterid;
|
||||
private String clusterId;
|
||||
|
||||
@SerializedName(ApiConstants.CLUSTER_NAME)
|
||||
@Param(description = "cluster name where the volume is allocated")
|
||||
private String clustername;
|
||||
private String clusterName;
|
||||
|
||||
@SerializedName(ApiConstants.POD_ID)
|
||||
@Param(description = "pod id of the volume")
|
||||
private String podid;
|
||||
private String podId;
|
||||
|
||||
@SerializedName(ApiConstants.POD_NAME)
|
||||
@Param(description = "pod name of the volume")
|
||||
private String podname;
|
||||
private String podName;
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
@ -751,35 +751,34 @@ public class VolumeResponse extends BaseResponseWithTagInformation implements Co
|
||||
}
|
||||
|
||||
public String getClusterId() {
|
||||
return clusterid;
|
||||
return clusterId;
|
||||
}
|
||||
|
||||
public void setClusterId(String clusterid) {
|
||||
this.clusterid = clusterid;
|
||||
public void setClusterId(String clusterId) {
|
||||
this.clusterId = clusterId;
|
||||
}
|
||||
|
||||
public String getClusterName() {
|
||||
return clustername;
|
||||
return clusterName;
|
||||
}
|
||||
|
||||
public void setClusterName(String clustername) {
|
||||
this.clustername = clustername;
|
||||
public void setClusterName(String clusterName) {
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
public String getPodId() {
|
||||
return podid;
|
||||
return podId;
|
||||
}
|
||||
|
||||
public void setPodId(String podid) {
|
||||
this.podid = podid;
|
||||
public void setPodId(String podId) {
|
||||
this.podId = podId;
|
||||
}
|
||||
|
||||
public String getPodName() {
|
||||
return podname;
|
||||
return podName;
|
||||
}
|
||||
|
||||
public void setPodName(String podname) {
|
||||
this.podname = podname;
|
||||
public void setPodName(String podName) {
|
||||
this.podName = podName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ public class ZoneResponse extends BaseResponse {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
public void setType(String networkType) {
|
||||
public void setNetworkType(String networkType) {
|
||||
this.networkType = networkType;
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +90,7 @@ public class DataCenterJoinDaoImpl extends GenericDaoBase<DataCenterJoinVO, Long
|
||||
zoneResponse.setDomainId(dataCenter.getDomainUuid());
|
||||
zoneResponse.setDomainName(dataCenter.getDomainName());
|
||||
|
||||
zoneResponse.setType(dataCenter.getNetworkType().toString());
|
||||
zoneResponse.setNetworkType(dataCenter.getNetworkType().toString());
|
||||
zoneResponse.setAllocationState(dataCenter.getAllocationState().toString());
|
||||
zoneResponse.setZoneToken(dataCenter.getZoneToken());
|
||||
zoneResponse.setDhcpProvider(dataCenter.getDhcpProvider());
|
||||
|
||||
@ -138,7 +138,7 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
|
||||
}
|
||||
gpus.add(gpuResponse);
|
||||
}
|
||||
hostResponse.setGpuGroups(gpus);
|
||||
hostResponse.setGpuGroup(gpus);
|
||||
}
|
||||
if (details.contains(HostDetails.all) || details.contains(HostDetails.capacity) || details.contains(HostDetails.stats) || details.contains(HostDetails.events)) {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user