Search in sources :

Example 1 with HostDeviceView

use of org.ovirt.engine.core.common.businessentities.HostDeviceView in project ovirt-engine by oVirt.

the class HostDeviceDaoTest method testGetExtendedHostDevicesByHostId.

@Test
public void testGetExtendedHostDevicesByHostId() {
    List<HostDeviceView> hostDevices = dao.getExtendedHostDevicesByHostId(FixturesTool.VDS_RHEL6_NFS_SPM);
    assertEquals(getEntitiesTotalCount(), hostDevices.size());
    for (HostDeviceView hostDevice : hostDevices) {
        assertEquals(FixturesTool.VDS_RHEL6_NFS_SPM, hostDevice.getHostId());
    }
}
Also used : HostDeviceView(org.ovirt.engine.core.common.businessentities.HostDeviceView) Test(org.junit.Test)

Example 2 with HostDeviceView

use of org.ovirt.engine.core.common.businessentities.HostDeviceView in project ovirt-engine by oVirt.

the class VmHostDeviceListModel method doAttachDevices.

private void doAttachDevices(Collection<EntityModel<HostDeviceView>> items) {
    List<String> deviceNamesToAttach = new ArrayList<>();
    for (EntityModel<HostDeviceView> model : items) {
        deviceNamesToAttach.add(model.getEntity().getDeviceName());
    }
    Frontend.getInstance().runAction(ActionType.AddVmHostDevices, new VmHostDevicesParameters(getEntity().getId(), deviceNamesToAttach), result -> {
        syncSearch();
        getWindow().stopProgress();
        setWindow(null);
    });
}
Also used : HostDeviceView(org.ovirt.engine.core.common.businessentities.HostDeviceView) VmHostDevicesParameters(org.ovirt.engine.core.common.action.VmHostDevicesParameters) ArrayList(java.util.ArrayList)

Aggregations

HostDeviceView (org.ovirt.engine.core.common.businessentities.HostDeviceView)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 VmHostDevicesParameters (org.ovirt.engine.core.common.action.VmHostDevicesParameters)1