Search in sources :

Example 26 with Template

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

the class LinkHelperTest method testTemplateTagLinks.

@Test
public void testTemplateTagLinks() throws Exception {
    Tag tag = new Tag();
    tag.setId(TAG_ID);
    tag.setTemplate(new Template());
    tag.getTemplate().setId(TEMPLATE_ID);
    LinkHelper.addLinks(tag);
    assertEquals(TEMPLATE_TAG_HREF, tag.getHref());
}
Also used : Tag(org.ovirt.engine.api.model.Tag) Template(org.ovirt.engine.api.model.Template) Test(org.junit.Test)

Example 27 with Template

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

the class LinkHelperTest method doTestVmLinks.

private void doTestVmLinks(boolean suggestParent) throws Exception {
    Vm vm = new Vm();
    vm.setId(VM_ID);
    vm.setCluster(new Cluster());
    vm.getCluster().setId(CLUSTER_ID);
    vm.setTemplate(new Template());
    vm.getTemplate().setId(TEMPLATE_ID);
    vm.setVmPool(new VmPool());
    vm.getVmPool().setId(VM_POOL_ID);
    if (suggestParent) {
        LinkHelper.addLinks(vm, Vm.class);
    } else {
        LinkHelper.addLinks(vm);
    }
    assertEquals(VM_HREF, vm.getHref());
    assertEquals(CLUSTER_HREF, vm.getCluster().getHref());
    assertEquals(TEMPLATE_HREF, vm.getTemplate().getHref());
    assertEquals(VM_POOL_HREF, vm.getVmPool().getHref());
}
Also used : VmPool(org.ovirt.engine.api.model.VmPool) Vm(org.ovirt.engine.api.model.Vm) Cluster(org.ovirt.engine.api.model.Cluster) Template(org.ovirt.engine.api.model.Template)

Example 28 with Template

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

the class BackendTemplateDiskResource method addParents.

@Override
public Disk addParents(Disk entity) {
    entity.setTemplate(new Template());
    entity.getTemplate().setId(templateId.toString());
    return entity;
}
Also used : Template(org.ovirt.engine.api.model.Template)

Example 29 with Template

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

the class BackendTemplateDisksResource method addParents.

@Override
public Disk addParents(Disk disk) {
    disk.setTemplate(new Template());
    disk.getTemplate().setId(templateId.toString());
    return disk;
}
Also used : Template(org.ovirt.engine.api.model.Template)

Example 30 with Template

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

the class BackendTemplateGraphicsConsolesResource method addParents.

@Override
protected GraphicsConsole addParents(GraphicsConsole model) {
    model.setTemplate(new Template());
    model.getTemplate().setId(guid.toString());
    return model;
}
Also used : Template(org.ovirt.engine.api.model.Template) VmTemplate(org.ovirt.engine.core.common.businessentities.VmTemplate)

Aggregations

Template (org.ovirt.engine.api.model.Template)57 VmTemplate (org.ovirt.engine.core.common.businessentities.VmTemplate)32 Test (org.junit.Test)21 Response (javax.ws.rs.core.Response)16 AsyncTaskStatus (org.ovirt.engine.core.common.businessentities.AsyncTaskStatus)12 Vm (org.ovirt.engine.api.model.Vm)11 WebApplicationException (javax.ws.rs.WebApplicationException)6 VmPool (org.ovirt.engine.api.model.VmPool)4 Cluster (org.ovirt.engine.api.model.Cluster)3 InstanceType (org.ovirt.engine.api.model.InstanceType)3 TimeZone (org.ovirt.engine.api.model.TimeZone)3 GetVmTemplateParameters (org.ovirt.engine.core.common.queries.GetVmTemplateParameters)3 ArrayList (java.util.ArrayList)2 Boot (org.ovirt.engine.api.model.Boot)2 Host (org.ovirt.engine.api.model.Host)2 OperatingSystem (org.ovirt.engine.api.model.OperatingSystem)2 StorageDomain (org.ovirt.engine.api.model.StorageDomain)2 Tag (org.ovirt.engine.api.model.Tag)2 TemplateVersion (org.ovirt.engine.api.model.TemplateVersion)2 Templates (org.ovirt.engine.api.model.Templates)2