use of org.ovirt.engine.api.model.DiskSnapshots in project ovirt-engine by oVirt.
the class V3DiskSnapshotsInAdapter method adapt.
@Override
public DiskSnapshots adapt(V3DiskSnapshots from) {
DiskSnapshots to = new DiskSnapshots();
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetActive()) {
to.setActive(from.getActive());
}
if (from.isSetSize()) {
to.setSize(from.getSize());
}
if (from.isSetTotal()) {
to.setTotal(from.getTotal());
}
to.getDiskSnapshots().addAll(adaptIn(from.getDiskSnapshots()));
return to;
}
use of org.ovirt.engine.api.model.DiskSnapshots in project ovirt-engine by oVirt.
the class BackendStorageDomainDiskSnapshotsResource method mapCollection.
protected DiskSnapshots mapCollection(List<Disk> entities) {
DiskSnapshots collection = new DiskSnapshots();
for (Disk disk : entities) {
DiskSnapshot diskSnapshot = getMapper(Disk.class, DiskSnapshot.class).map(disk, null);
// this code generates back-link to the corresponding SD
diskSnapshot.setStorageDomain(new StorageDomain());
diskSnapshot.getStorageDomain().setId(this.storageDomainId.toString());
collection.getDiskSnapshots().add(addLinks(populate(diskSnapshot, disk)));
}
return collection;
}
Aggregations