CLOUDSTACK-6373: listHost API response is not listing all the details of vgpuType.

This commit is contained in:
Sanjay Tripathi 2014-04-10 13:55:25 +05:30
parent 1d0b14673d
commit 6a725c6795
3 changed files with 62 additions and 11 deletions

View File

@ -591,7 +591,13 @@ public class ApiConstants {
public static final String GPUGROUPNAME = "gpugroupname";
public static final String VGPU = "vgpu";
public static final String VGPUTYPE = "vgputype";
public static final String VIDEORAM = "videoram";
public static final String MAXHEADS = "maxheads";
public static final String MAXRESOLUTIONX = "maxresolutionx";
public static final String MAXRESOLUTIONY = "maxresolutiony";
public static final String MAXVGPUPERPGPU = "maxvgpuperpgpu";
public static final String REMAININGCAPACITY = "remainingcapacity";
public static final String MAXCAPACITY = "maxcapacity";
public static final String DISTRIBUTED_VPC_ROUTER = "distributedvpcrouter";
public static final String READ_ONLY = "readonly";
public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc";

View File

@ -29,24 +29,63 @@ public class VgpuResponse extends BaseResponse {
@Param(description = "Model Name of vGPU")
private String name;
@SerializedName(ApiConstants.REMAININGCAPACITY)
@Param(description = "No. of more VMs can be deployped with this vGPU type")
private Long capacity;
@SerializedName(ApiConstants.VIDEORAM)
@Param(description = "Video RAM for this vGPU type")
private Long videoRam;
public String getName() {
return name;
}
@SerializedName(ApiConstants.MAXHEADS)
@Param(description = "Maximum displays per user")
private Long maxHeads;
@SerializedName(ApiConstants.MAXRESOLUTIONX)
@Param(description = "Maximum X resolution per display")
private Long maxResolutionX;
@SerializedName(ApiConstants.MAXRESOLUTIONY)
@Param(description = "Maximum Y resolution per display")
private Long maxResolutionY;
@SerializedName(ApiConstants.MAXVGPUPERPGPU)
@Param(description = "Maximum no. of vgpu per gpu card (pgpu)")
private Long maxVgpuPerPgpu;
@SerializedName(ApiConstants.REMAININGCAPACITY)
@Param(description = "Remaining capacity in terms of no. of more VMs that can be deployped with this vGPU type")
private Long remainingCapacity;
@SerializedName(ApiConstants.MAXCAPACITY)
@Param(description = "Maximum vgpu can be created with this vgpu type on the given gpu group")
private Long maxCapacity;
public void setName(String name) {
this.name = name;
}
public Long getCapacity() {
return capacity;
public void setVideoRam(Long videoRam) {
this.videoRam = videoRam;
}
public void setCapacity(Long capacity) {
this.capacity = capacity;
public void setMaxHeads(Long maxHeads) {
this.maxHeads = maxHeads;
}
public void setMaxResolutionX(Long maxResolutionX) {
this.maxResolutionX = maxResolutionX;
}
public void setMaxResolutionY(Long maxResolutionY) {
this.maxResolutionY = maxResolutionY;
}
public void setMaxVgpuPerPgpu(Long maxVgpuPerPgpu) {
this.maxVgpuPerPgpu = maxVgpuPerPgpu;
}
public void setRemainingCapacity(Long remainingCapacity) {
this.remainingCapacity = remainingCapacity;
}
public void setmaxCapacity(Long maxCapacity) {
this.maxCapacity = maxCapacity;
}
}

View File

@ -108,7 +108,13 @@ public class HostJoinDaoImpl extends GenericDaoBase<HostJoinVO, Long> implements
for (VGPUTypesVO vgpuType : vgpuTypes) {
VgpuResponse vgpuResponse = new VgpuResponse();
vgpuResponse.setName(vgpuType.getVgpuType());
vgpuResponse.setCapacity(vgpuType.getRemainingCapacity());
vgpuResponse.setVideoRam(vgpuType.getVideoRam());
vgpuResponse.setMaxHeads(vgpuType.getMaxHeads());
vgpuResponse.setMaxResolutionX(vgpuType.getMaxResolutionX());
vgpuResponse.setMaxResolutionY(vgpuType.getMaxResolutionY());
vgpuResponse.setMaxVgpuPerPgpu(vgpuType.getMaxVgpuPerPgpu());
vgpuResponse.setRemainingCapacity(vgpuType.getRemainingCapacity());
vgpuResponse.setmaxCapacity(vgpuType.getMaxCapacity());
vgpus.add(vgpuResponse);
}
gpuResponse.setVgpu(vgpus);