Skip to content

Commit 7fe3c45

Browse files
Damodarkishankavala
authored andcommitted
CLOUDSTACK-7729: listVMSnapshot API not returning parent id in response
1 parent 55e11cd commit 7fe3c45

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,15 @@ public String getParentName() {
184184
return parentName;
185185
}
186186

187-
public String getType() {
187+
public String getParent() {
188+
return parent;
189+
}
190+
191+
public void setParent(String parent) {
192+
this.parent = parent;
193+
}
194+
195+
public String getType() {
188196
return type;
189197
}
190198

‎server/src/com/cloud/api/ApiResponseHelper.java‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,9 @@ public VMSnapshotResponse createVMSnapshotResponse(VMSnapshot vmSnapshot) {
529529
vmSnapshotResponse.setVirtualMachineid(vm.getUuid());
530530
}
531531
if (vmSnapshot.getParent() != null) {
532-
vmSnapshotResponse.setParentName(ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent()).getDisplayName());
532+
VMSnapshot vmSnapshotParent = ApiDBUtils.getVMSnapshotById(vmSnapshot.getParent());
533+
vmSnapshotResponse.setParent(vmSnapshotParent.getUuid());
534+
vmSnapshotResponse.setParentName(vmSnapshotParent.getDisplayName());
533535
}
534536
vmSnapshotResponse.setCurrent(vmSnapshot.getCurrent());
535537
vmSnapshotResponse.setType(vmSnapshot.getType().toString());

0 commit comments

Comments
 (0)