Skip to content

Commit

Permalink
restapi: revert snapshot link
Browse files Browse the repository at this point in the history
Partial revert of 152deb4

Restoring the suggested parent was not enough and it seems too
complicated to get this right for the value it provides

Bug-Url: https://bugzilla.redhat.com/2075435
Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
  • Loading branch information
bennyz authored and ahadas committed Apr 25, 2022
1 parent c9462ac commit 68b4b25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import org.ovirt.engine.api.model.Action;
import org.ovirt.engine.api.model.Backup;
import org.ovirt.engine.api.model.Vm;
import org.ovirt.engine.api.resource.ActionResource;
import org.ovirt.engine.api.resource.VmBackupDisksResource;
import org.ovirt.engine.api.resource.VmBackupResource;
Expand Down Expand Up @@ -40,15 +39,7 @@ public BackendVmBackupsResource getParent() {

@Override
public Backup get() {
Backup backup = performGet(QueryType.GetVmBackupById, new IdQueryParameters(guid));

if (backup.isSetSnapshot()) {
Vm vm = new Vm();
vm.setId(vmId.toString());
backup.getSnapshot().setVm(vm);
}

return addLinks(backup);
return addLinks(performGet(QueryType.GetVmBackupById, new IdQueryParameters(guid)));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,7 @@ public Backups list() {
private org.ovirt.engine.api.model.Backups mapCollection(java.util.List<org.ovirt.engine.core.common.businessentities.VmBackup> entities) {
Backups collection = new Backups();
for (org.ovirt.engine.core.common.businessentities.VmBackup entity : entities) {
Backup backup = map(entity);

if (backup.isSetSnapshot()) {
Vm vm = new Vm();
vm.setId(vmId.toString());
backup.getSnapshot().setVm(vm);
}

collection.getBackups().add(addLinks(backup, Vm.class));
collection.getBackups().add(addLinks(map(entity), Vm.class));
}
return collection;
}
Expand Down

0 comments on commit 68b4b25

Please sign in to comment.