private void syncSelectedItemWithNetworkInterface(final VnicInstanceType model) { final VmNetworkInterface vnic = model.getNetworkInterface(); VnicProfileView profile = model.getSelectedItem(); vnic.setVnicProfileId(profile != null ? profile.getId() : null); vnic.setNetworkName(profile != null ? profile.getNetworkName() : null); }
existingVnic.setVnicProfileId(editedProfileId); existingVnic.setNetworkName(editedVnic.getNetworkName()); updateVnicParameters.add(createAddInterfaceParameter(vmId, existingVnic));
entity.setVnicProfileId(GuidUtils.asGuid(model.getVnicProfile().getId())); } else { entity.setVnicProfileId(null);
@BeforeEach @Override public void setUp() throws Exception { super.setUp(); existingVmInterface = dao.get(FixturesTool.VM_NETWORK_INTERFACE); existingTemplateInterface = dao.get(FixturesTool.TEMPLATE_NETWORK_INTERFACE); newVmInterface = new VmNetworkInterface(); newVmInterface.setStatistics(new VmNetworkStatistics()); newVmInterface.setId(Guid.newGuid()); newVmInterface.setVnicProfileId(FixturesTool.VM_NETWORK_INTERFACE_PROFILE); newVmInterface.setName("eth77"); newVmInterface.setNetworkName("enginet"); newVmInterface.setLinked(true); newVmInterface.setSpeed(1000); newVmInterface.setType(3); newVmInterface.setMacAddress("01:C0:81:21:71:17"); newVmDevice.setType(VmDeviceGeneralType.INTERFACE); newVmDevice.setDevice("bridge"); newVmDevice.setAddress("sample"); newVmDevice.setManaged(true); newVmDevice.setPlugged(true); newVmDevice.setReadOnly(false); Map<String, String> customProp = new LinkedHashMap<>(); customProp.put("prop1", "val1"); newVmDevice.setCustomProperties(customProp); }
nic.setVnicProfileId(profile.getId()); nic.setNetworkName(profile.getNetworkName()); nic.setLinked(getLinked().getEntity());