Search in sources :

Example 61 with Vm

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

the class NicStatisticalQuery method clone.

private Nic clone(Nic parent) {
    Nic nic = new Nic();
    nic.setId(parent.getId());
    nic.setVm(new Vm());
    nic.getVm().setId(parent.getVm().getId());
    return nic;
}
Also used : Vm(org.ovirt.engine.api.model.Vm) Nic(org.ovirt.engine.api.model.Nic)

Example 62 with Vm

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

the class DiskStatisticalQuery method clone.

private Disk clone(Disk parent) {
    Disk disk = new Disk();
    disk.setId(parent.getId());
    if (parent.isSetVm()) {
        disk.setVm(new Vm());
        disk.getVm().setId(parent.getVm().getId());
    }
    return disk;
}
Also used : Vm(org.ovirt.engine.api.model.Vm) Disk(org.ovirt.engine.api.model.Disk)

Example 63 with Vm

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

the class BackendExternalVmImportsResourceTest method createVmImport.

private ExternalVmImport createVmImport() {
    File file = new File();
    file.setId(DRIVERS_ISO);
    ExternalVmImport vmImport = new ExternalVmImport();
    vmImport.setName(EXTERNAL_VM_NAME);
    vmImport.setVm(new Vm());
    vmImport.getVm().setName(CREATED_VM_NAME);
    vmImport.setCluster(new Cluster());
    vmImport.getCluster().setId(CLUSTER_ID.toString());
    vmImport.setStorageDomain(new StorageDomain());
    vmImport.getStorageDomain().setId(STORAGE_DOMAIN_ID.toString());
    vmImport.setHost(new Host());
    vmImport.getHost().setId(HOST_ID.toString());
    vmImport.setSparse(true);
    vmImport.setProvider(ExternalVmProviderType.VMWARE);
    vmImport.setDriversIso(file);
    vmImport.setUsername(USERNAME);
    vmImport.setPassword(PASSWORD);
    vmImport.setUrl(VMWARE_URL);
    return vmImport;
}
Also used : StorageDomain(org.ovirt.engine.api.model.StorageDomain) ExternalVmImport(org.ovirt.engine.api.model.ExternalVmImport) Vm(org.ovirt.engine.api.model.Vm) Cluster(org.ovirt.engine.api.model.Cluster) Host(org.ovirt.engine.api.model.Host) File(org.ovirt.engine.api.model.File)

Example 64 with Vm

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

the class VmMapperTest method testGlobalSpiceProxy.

@Test
public void testGlobalSpiceProxy() {
    org.ovirt.engine.core.common.businessentities.VM entity = new org.ovirt.engine.core.common.businessentities.VM();
    mcr.mockConfigValue(ConfigValues.SpiceProxyDefault, GLOBAL_SPICE_PROXY);
    Vm model = VmMapper.map(entity, (Vm) null);
    assertEquals(GLOBAL_SPICE_PROXY, model.getDisplay().getProxy());
}
Also used : Vm(org.ovirt.engine.api.model.Vm) Test(org.junit.Test)

Example 65 with Vm

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

the class VmMapperTest method testPoolSpiceProxy.

@Test
public void testPoolSpiceProxy() {
    org.ovirt.engine.core.common.businessentities.VM entity = new org.ovirt.engine.core.common.businessentities.VM();
    entity.setVmPoolSpiceProxy(POOL_SPICE_PROXY);
    Vm model = VmMapper.map(entity, (Vm) null);
    assertEquals(POOL_SPICE_PROXY, model.getDisplay().getProxy());
}
Also used : Vm(org.ovirt.engine.api.model.Vm) Test(org.junit.Test)

Aggregations

Vm (org.ovirt.engine.api.model.Vm)145 Test (org.junit.Test)80 Response (javax.ws.rs.core.Response)26 Host (org.ovirt.engine.api.model.Host)21 WebApplicationException (javax.ws.rs.WebApplicationException)19 Guid (org.ovirt.engine.core.compat.Guid)15 Template (org.ovirt.engine.api.model.Template)11 Hosts (org.ovirt.engine.api.model.Hosts)10 Action (org.ovirt.engine.api.model.Action)9 VmPlacementPolicy (org.ovirt.engine.api.model.VmPlacementPolicy)9 Vms (org.ovirt.engine.api.model.Vms)8 RunVmOnceParams (org.ovirt.engine.core.common.action.RunVmOnceParams)8 VM (org.ovirt.engine.core.common.businessentities.VM)8 Disk (org.ovirt.engine.api.model.Disk)7 IdQueryParameters (org.ovirt.engine.core.common.queries.IdQueryParameters)7 ArrayList (java.util.ArrayList)6 Nic (org.ovirt.engine.api.model.Nic)6 VmManagementParametersBase (org.ovirt.engine.core.common.action.VmManagementParametersBase)6 Configuration (org.ovirt.engine.api.model.Configuration)5 DiskAttachment (org.ovirt.engine.api.model.DiskAttachment)5