Merge remote-tracking branch 'origin/4.14'

This commit is contained in:
Rohit Yadav 2020-08-21 14:31:52 +05:30
commit 961f3ece41
2 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;
import com.cloud.hypervisor.Hypervisor;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponseWithTagInformation;
import org.apache.cloudstack.api.EntityReference;
@ -100,6 +101,10 @@ public class VMSnapshotResponse extends BaseResponseWithTagInformation implement
@Param(description = "the domain associated with the disk volume")
private String domainName;
@SerializedName(ApiConstants.HYPERVISOR)
@Param(description = "the type of hypervisor on which snapshot is stored")
private Hypervisor.HypervisorType hypervisor;
public VMSnapshotResponse() {
tags = new LinkedHashSet<ResourceTagResponse>();
}
@ -236,4 +241,12 @@ public class VMSnapshotResponse extends BaseResponseWithTagInformation implement
public void setTags(Set<ResourceTagResponse> tags) {
this.tags = tags;
}
public Hypervisor.HypervisorType getHypervisor() {
return hypervisor;
}
public void setHypervisor(Hypervisor.HypervisorType hypervisor) {
this.hypervisor = hypervisor;
}
}

View File

@ -622,6 +622,7 @@ public class ApiResponseHelper implements ResponseGenerator {
UserVm vm = ApiDBUtils.findUserVmById(vmSnapshot.getVmId());
if (vm != null) {
vmSnapshotResponse.setVirtualMachineid(vm.getUuid());
vmSnapshotResponse.setHypervisor(vm.getHypervisorType());
DataCenterVO datacenter = ApiDBUtils.findZoneById(vm.getDataCenterId());
if (datacenter != null) {
vmSnapshotResponse.setZoneId(datacenter.getUuid());