Search in sources :

Example 1 with ExternalVmImport

use of org.ovirt.engine.api.model.ExternalVmImport 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 2 with ExternalVmImport

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

the class BackendExternalVmImportsResourceTest method testVmWareImport.

@Test
public void testVmWareImport() {
    VM externalVm = new VM();
    externalVm.setName(EXTERNAL_VM_NAME);
    setUpActionExpectations(ActionType.ImportVmFromExternalUrl, ImportVmFromExternalUrlParameters.class, new String[] { "OriginType", "StorageDomainId", "ClusterId", "Url", "Username", "Password", "ProxyHostId", "VirtioIsoName", "ExternalName", "VolumeType", "NewVmName" }, new Object[] { ORIGIN_TYPE, STORAGE_DOMAIN_ID, CLUSTER_ID, VMWARE_URL, USERNAME, PASSWORD, HOST_ID, DRIVERS_ISO, EXTERNAL_VM_NAME, VOLUME_TYPE, CREATED_VM_NAME }, true, true, externalVm, true);
    ExternalVmImport vmImport = createVmImport();
    resource.add(vmImport);
}
Also used : ExternalVmImport(org.ovirt.engine.api.model.ExternalVmImport) VM(org.ovirt.engine.core.common.businessentities.VM) Test(org.junit.Test)

Aggregations

ExternalVmImport (org.ovirt.engine.api.model.ExternalVmImport)2 Test (org.junit.Test)1 Cluster (org.ovirt.engine.api.model.Cluster)1 File (org.ovirt.engine.api.model.File)1 Host (org.ovirt.engine.api.model.Host)1 StorageDomain (org.ovirt.engine.api.model.StorageDomain)1 Vm (org.ovirt.engine.api.model.Vm)1 VM (org.ovirt.engine.core.common.businessentities.VM)1