Skip to content

Commit 5e9b25b

Browse files
CLOUDSTACK-6373: listHost API response is not listing all the details of vgpuType.
1 parent 87f6c6f commit 5e9b25b

3 files changed

Lines changed: 61 additions & 10 deletions

File tree

‎api/src/org/apache/cloudstack/api/ApiConstants.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,13 @@ public class ApiConstants {
591591
public static final String GPUGROUPNAME = "gpugroupname";
592592
public static final String VGPU = "vgpu";
593593
public static final String VGPUTYPE = "vgputype";
594+
public static final String VIDEORAM = "videoram";
595+
public static final String MAXHEADS = "maxheads";
596+
public static final String MAXRESOLUTIONX = "maxresolutionx";
597+
public static final String MAXRESOLUTIONY = "maxresolutiony";
598+
public static final String MAXVGPUPERPGPU = "maxvgpuperpgpu";
594599
public static final String REMAININGCAPACITY = "remainingcapacity";
600+
public static final String MAXCAPACITY = "maxcapacity";
595601
public static final String DISTRIBUTED_VPC_ROUTER = "distributedvpcrouter";
596602
public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc";
597603
public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet";

‎api/src/org/apache/cloudstack/api/response/VgpuResponse.java‎

Lines changed: 48 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,63 @@ public class VgpuResponse extends BaseResponse {
2929
@Param(description = "Model Name of vGPU")
3030
private String name;
3131

32+
@SerializedName(ApiConstants.VIDEORAM)
33+
@Param(description = "Video RAM for this vGPU type")
34+
private Long videoRam;
35+
36+
@SerializedName(ApiConstants.MAXHEADS)
37+
@Param(description = "Maximum displays per user")
38+
private Long maxHeads;
39+
40+
@SerializedName(ApiConstants.MAXRESOLUTIONX)
41+
@Param(description = "Maximum X resolution per display")
42+
private Long maxResolutionX;
43+
44+
@SerializedName(ApiConstants.MAXRESOLUTIONY)
45+
@Param(description = "Maximum Y resolution per display")
46+
private Long maxResolutionY;
47+
48+
@SerializedName(ApiConstants.MAXVGPUPERPGPU)
49+
@Param(description = "Maximum no. of vgpu per gpu card (pgpu)")
50+
private Long maxVgpuPerPgpu;
51+
3252
@SerializedName(ApiConstants.REMAININGCAPACITY)
33-
@Param(description = "No. of more VMs can be deployped with this vGPU type")
34-
private Long capacity;
53+
@Param(description = "Remaining capacity in terms of no. of more VMs that can be deployped with this vGPU type")
54+
private Long remainingCapacity;
3555

36-
public String getName() {
37-
return name;
38-
}
56+
@SerializedName(ApiConstants.MAXCAPACITY)
57+
@Param(description = "Maximum vgpu can be created with this vgpu type on the given gpu group")
58+
private Long maxCapacity;
3959

4060
public void setName(String name) {
4161
this.name = name;
4262
}
4363

44-
public Long getCapacity() {
45-
return capacity;
64+
public void setVideoRam(Long videoRam) {
65+
this.videoRam = videoRam;
66+
}
67+
68+
public void setMaxHeads(Long maxHeads) {
69+
this.maxHeads = maxHeads;
4670
}
4771

48-
public void setCapacity(Long capacity) {
49-
this.capacity = capacity;
72+
public void setMaxResolutionX(Long maxResolutionX) {
73+
this.maxResolutionX = maxResolutionX;
5074
}
5175

76+
public void setMaxResolutionY(Long maxResolutionY) {
77+
this.maxResolutionY = maxResolutionY;
78+
}
79+
80+
public void setMaxVgpuPerPgpu(Long maxVgpuPerPgpu) {
81+
this.maxVgpuPerPgpu = maxVgpuPerPgpu;
82+
}
83+
84+
public void setRemainingCapacity(Long remainingCapacity) {
85+
this.remainingCapacity = remainingCapacity;
86+
}
87+
88+
public void setmaxCapacity(Long maxCapacity) {
89+
this.maxCapacity = maxCapacity;
90+
}
5291
}

‎server/src/com/cloud/api/query/dao/HostJoinDaoImpl.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ public HostResponse newHostResponse(HostJoinVO host, EnumSet<HostDetails> detail
108108
for (VGPUTypesVO vgpuType : vgpuTypes) {
109109
VgpuResponse vgpuResponse = new VgpuResponse();
110110
vgpuResponse.setName(vgpuType.getVgpuType());
111-
vgpuResponse.setCapacity(vgpuType.getRemainingCapacity());
111+
vgpuResponse.setVideoRam(vgpuType.getVideoRam());
112+
vgpuResponse.setMaxHeads(vgpuType.getMaxHeads());
113+
vgpuResponse.setMaxResolutionX(vgpuType.getMaxResolutionX());
114+
vgpuResponse.setMaxResolutionY(vgpuType.getMaxResolutionY());
115+
vgpuResponse.setMaxVgpuPerPgpu(vgpuType.getMaxVgpuPerPgpu());
116+
vgpuResponse.setRemainingCapacity(vgpuType.getRemainingCapacity());
117+
vgpuResponse.setmaxCapacity(vgpuType.getMaxCapacity());
112118
vgpus.add(vgpuResponse);
113119
}
114120
gpuResponse.setVgpu(vgpus);

0 commit comments

Comments
 (0)