bug 8257: Returning hypervisor type in Listvm command so that volume gets attached to the corresponding vm's

This commit is contained in:
nit 2011-01-31 19:10:56 +05:30
parent 94f9c1297f
commit f53e18b0ab
2 changed files with 15 additions and 1 deletions

13
api/src/com/cloud/api/response/UserVmResponse.java Normal file → Executable file
View File

@ -145,7 +145,18 @@ public class UserVmResponse extends BaseResponse {
@SerializedName("nic") @Param(description="the list of nics associated with vm", responseObject = NicResponse.class)
private List<NicResponse> nics;
public Long getObjectId() {
@SerializedName("hypervisor") @Param(description="the hypervisor on which the template runs")
private String hypervisor;
public String getHypervisor() {
return hypervisor;
}
public void setHypervisor(String hypervisor) {
this.hypervisor = hypervisor;
}
public Long getObjectId() {
return getId();
}

View File

@ -1021,6 +1021,9 @@ public class ApiResponseHelper implements ResponseGenerator {
userVmResponse.setHostName(ApiDBUtils.findHostById(userVm.getHostId()).getName());
}
if(userVm.getHypervisorType() != null){
userVmResponse.setHypervisor(userVm.getHypervisorType().toString());
}
// Template Info
VMTemplateVO template = ApiDBUtils.findTemplateById(userVm.getTemplateId());
if (template != null) {