CLOUDSTACK-7729: listVMSnapshot API not returning parent id in response

This commit is contained in:
Damodar 2014-10-15 16:53:26 +05:30 committed by Kishan Kavala
parent 55e11cddca
commit 7fe3c45142
2 changed files with 12 additions and 2 deletions

View File

@ -184,7 +184,15 @@ public class VMSnapshotResponse extends BaseResponse implements ControlledEntity
return parentName;
}
public String getType() {
public String getParent() {
return parent;
}
public void setParent(String parent) {
this.parent = parent;
}
public String getType() {
return type;
}

View File

@ -529,7 +529,9 @@ public class ApiResponseHelper implements ResponseGenerator {
vmSnapshotResponse.setVirtualMachineid(vm.getUuid());
}
if (vmSnapshot.getParent() != null) {
vmSnapshotResponse.setParentName(ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent()).getDisplayName());
VMSnapshot vmSnapshotParent = ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent());
vmSnapshotResponse.setParent(vmSnapshotParent.getUuid());
vmSnapshotResponse.setParentName(vmSnapshotParent.getDisplayName());
}
vmSnapshotResponse.setCurrent(vmSnapshot.getCurrent());
vmSnapshotResponse.setType(vmSnapshot.getType().toString());