public HostSetupNetworksParameters(HostSetupNetworksParameters other) { super(other.getVdsId()); setNetworkAttachments(other.networkAttachments); setRemovedNetworkAttachments(other.removedNetworkAttachments); setCreateOrUpdateBonds(other.createOrUpdateBonds); setRemovedBonds(other.removedBonds); setRemovedUnmanagedNetworks(other.removedUnmanagedNetworks); setLabels(other.labels); setRemovedLabels(other.removedLabels); setRollbackOnFailure(other.rollbackOnFailure); setConectivityTimeout(other.conectivityTimeout); setCommitOnSuccess(other.commitOnSuccess); }
public HostSetupNetworksParameters(Guid hostId) { super(hostId); setNetworkAttachments(new ArrayList<NetworkAttachment>()); setRemovedNetworkAttachments(new HashSet<Guid>()); setCreateOrUpdateBonds(new ArrayList<CreateOrUpdateBond>()); setRemovedBonds(new HashSet<Guid>()); setRemovedUnmanagedNetworks(new HashSet<String>()); setLabels(new HashSet<NicLabel>()); setRemovedLabels(new HashSet<String>()); }
public HostSetupNetworksParameters createHostSetupNetworksParameters() { HostSetupNetworksParameters result = new HostSetupNetworksParameters(getEntity().getId()); for (NetworkAttachment attachment : hostSetupNetworksParametersData.getNetworkAttachments()) { attachment.setOverrideConfiguration(shouldSyncNetwork(attachment.getNetworkName())); } result.setNetworkAttachments( new ArrayList<NetworkAttachment>(hostSetupNetworksParametersData.getNetworkAttachments())); result.setRemovedNetworkAttachments(hostSetupNetworksParametersData.getRemovedNetworkAttachments()); result.setCreateOrUpdateBonds(new ArrayList<CreateOrUpdateBond>(hostSetupNetworksParametersData.getBonds())); result.setRemovedBonds(new HashSet<>(hostSetupNetworksParametersData.getRemovedBonds())); result.setRemovedUnmanagedNetworks(hostSetupNetworksParametersData.getRemovedUnmanagedNetworks()); result.setLabels(hostSetupNetworksParametersData.getLabels()); result.setRemovedLabels(hostSetupNetworksParametersData.getRemovedLabels()); result.setCommitOnSuccess(commitChanges.getEntity()); return result; }
private HostSetupNetworksParameters toParameters(Action action) { HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(guid); Map<Guid, NetworkAttachment> attachmentsById = getBackendNetworkAttachments(); .getNetworkAttachments()) { NetworkAttachment attachment = mapNetworkAttachment(attachmentsById, model); parameters.getNetworkAttachments().add(attachment); Entities.businessEntitiesById(parameters.getNetworkAttachments()); for (org.ovirt.engine.api.model.NetworkAttachment model : action.getSynchronizedNetworkAttachments() .getNetworkAttachments()) { NetworkAttachment networkAttachment = attachmentsById.get(networkAttachmentId); networkAttachment.setOverrideConfiguration(true); parameters.getNetworkAttachments().add(networkAttachment); } else { return handleError(new EntityNotFoundException("NetworkAttachment.id: " + model.getId()), true); parameters.getLabels().add(nicLabel); parameters.getRemovedLabels().add(label.getId()); .getNetworkAttachments()) { NetworkAttachment attachment = mapNetworkAttachment(attachmentsById, model); parameters.getRemovedNetworkAttachments().add(attachment.getId()); for (HostNic bond : action.getModifiedBonds().getHostNics()) { completeSlaveNames(nicsFromBackend, bond); parameters.getCreateOrUpdateBonds().add(mapBonds(bonds, bond));
@Override public Response remove() { get(); HostSetupNetworksParameters parameters = new HostSetupNetworksParameters(hostId); parameters.setRemovedUnmanagedNetworks(Collections.singleton(id)); return performAction(ActionType.HostSetupNetworks, parameters); }