use of org.ovirt.engine.core.common.action.VmHostDevicesParameters in project ovirt-engine by oVirt.
the class BackendVmHostDevicesResource method add.
@Override
public Response add(final HostDevice hostDevice) {
validateParameters(hostDevice, "id|name");
String deviceName = hostDevice.getName();
if (hostDevice.isSetId()) {
// in case both 'name' and 'id' is set, 'id' takes priority
deviceName = HexUtils.hex2string(hostDevice.getId());
}
return performCreate(ActionType.AddVmHostDevices, new VmHostDevicesParameters(vmId, deviceName), new DeviceNameResolver(deviceName));
}
use of org.ovirt.engine.core.common.action.VmHostDevicesParameters in project ovirt-engine by oVirt.
the class VmHostDeviceListModel method onRemove.
private void onRemove() {
final ConfirmationModel model = (ConfirmationModel) getConfirmWindow();
if (model.getProgress() != null) {
return;
}
model.startProgress();
ArrayList<String> deviceNames = getSelectedPrimaryDeviceNames();
Frontend.getInstance().runAction(ActionType.RemoveVmHostDevices, new VmHostDevicesParameters(getEntity().getId(), deviceNames), result -> {
model.stopProgress();
setConfirmWindow(null);
});
}
use of org.ovirt.engine.core.common.action.VmHostDevicesParameters 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);
});
}
Aggregations