use of org.ovirt.engine.api.model.StorageDomain 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;
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class LinkHelperTest method testStorageDomainTemplateLinks.
@Test
public void testStorageDomainTemplateLinks() throws Exception {
Template template = new Template();
template.setId(TEMPLATE_ID);
template.setStorageDomain(new StorageDomain());
template.getStorageDomain().setId(STORAGE_DOMAIN_ID);
template = LinkHelper.addLinks(template);
assertEquals(STORAGE_DOMAIN_TEMPLATE_HREF, template.getHref());
assertEquals(STORAGE_DOMAIN_HREF, template.getStorageDomain().getHref());
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class LinkHelperTest method testAttachedStorageDomainLinks.
@Test
public void testAttachedStorageDomainLinks() throws Exception {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(STORAGE_DOMAIN_ID);
storageDomain.setDataCenter(new DataCenter());
storageDomain.getDataCenter().setId(DATA_CENTER_ID);
LinkHelper.addLinks(storageDomain);
assertEquals(ATTACHED_STORAGE_DOMAIN_HREF, storageDomain.getHref());
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class LinkHelperTest method testStorageDomainVmLinks.
@Test
public void testStorageDomainVmLinks() throws Exception {
Vm vm = new Vm();
vm.setId(VM_ID);
vm.setStorageDomain(new StorageDomain());
vm.getStorageDomain().setId(STORAGE_DOMAIN_ID);
vm = LinkHelper.addLinks(vm);
assertEquals(STORAGE_DOMAIN_VM_HREF, vm.getHref());
assertEquals(STORAGE_DOMAIN_HREF, vm.getStorageDomain().getHref());
}
use of org.ovirt.engine.api.model.StorageDomain in project ovirt-engine by oVirt.
the class AbstractBackendStorageDomainContentsResource method getStorageDomainModel.
public StorageDomain getStorageDomainModel() {
StorageDomain storageDomain = new StorageDomain();
storageDomain.setId(storageDomainId.toString());
return storageDomain;
}
Aggregations