Search in sources :

Example 1 with DiskSnapshots

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;
}
Also used : V3DiskSnapshots(org.ovirt.engine.api.v3.types.V3DiskSnapshots) DiskSnapshots(org.ovirt.engine.api.model.DiskSnapshots)

Example 2 with DiskSnapshots

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;
}
Also used : StorageDomain(org.ovirt.engine.api.model.StorageDomain) DiskSnapshots(org.ovirt.engine.api.model.DiskSnapshots) DiskSnapshot(org.ovirt.engine.api.model.DiskSnapshot) Disk(org.ovirt.engine.core.common.businessentities.storage.Disk)

Aggregations

DiskSnapshots (org.ovirt.engine.api.model.DiskSnapshots)2 DiskSnapshot (org.ovirt.engine.api.model.DiskSnapshot)1 StorageDomain (org.ovirt.engine.api.model.StorageDomain)1 V3DiskSnapshots (org.ovirt.engine.api.v3.types.V3DiskSnapshots)1 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)1