Search in sources :

Example 6 with DiskSnapshot

use of org.ovirt.engine.api.model.DiskSnapshot in project ovirt-engine by oVirt.

the class DiskSnapshotMapper method map.

@Mapping(from = org.ovirt.engine.core.common.businessentities.storage.Disk.class, to = DiskSnapshot.class)
public static DiskSnapshot map(org.ovirt.engine.core.common.businessentities.storage.Disk entity, DiskSnapshot template) {
    if (template == null) {
        template = new DiskSnapshot();
    }
    DiskSnapshot model = (DiskSnapshot) DiskMapper.map(entity, template);
    Disk disk = new Disk();
    disk.setId(entity.getId().toString());
    model.setDisk(disk);
    DiskImage diskImage = (DiskImage) entity;
    model.setId(diskImage.getImageId().toString());
    model.setImageId(null);
    return model;
}
Also used : DiskSnapshot(org.ovirt.engine.api.model.DiskSnapshot) Disk(org.ovirt.engine.api.model.Disk) DiskImage(org.ovirt.engine.core.common.businessentities.storage.DiskImage)

Aggregations

DiskSnapshot (org.ovirt.engine.api.model.DiskSnapshot)6 Test (org.junit.Test)2 StorageDomain (org.ovirt.engine.api.model.StorageDomain)2 Disk (org.ovirt.engine.core.common.businessentities.storage.Disk)2 DiskImage (org.ovirt.engine.core.common.businessentities.storage.DiskImage)2 Disk (org.ovirt.engine.api.model.Disk)1 DiskSnapshots (org.ovirt.engine.api.model.DiskSnapshots)1 Statistics (org.ovirt.engine.api.model.Statistics)1 StorageDomains (org.ovirt.engine.api.model.StorageDomains)1 Vms (org.ovirt.engine.api.model.Vms)1 V3DiskSnapshot (org.ovirt.engine.api.v3.types.V3DiskSnapshot)1 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)1