host.setPort(54321); host.setSshPort(22); // TODO: get from UI, till then using defaults. host.setSshUsername("root"); //$NON-NLS-1$
host.setPort(54321); host.setSshPort(22); // TODO: get from UI, till than using defaults. host.setSshUsername("root"); //$NON-NLS-1$
@Mapping(from = Host.class, to = VdsOperationActionParameters.class) public static VdsOperationActionParameters map(Host host, VdsOperationActionParameters params) { params.setPassword(host.getRootPassword()); if (host.isSetSsh()) { if (host.getSsh().isSetUser()) { if (host.getSsh().getUser().isSetPassword()) { // For backward compatibility giving priority to rootPassword field if (params.getPassword() == null) { params.setPassword(host.getSsh().getUser().getPassword()); } } if (host.getSsh().getUser().isSetUserName()) { params.getvds().setSshUsername(host.getSsh().getUser().getUserName()); } } if (host.getSsh().isSetPort()) { params.getvds().setSshPort(host.getSsh().getPort()); } if (host.getSsh().isSetFingerprint()) { params.getvds().setSshKeyFingerprint(host.getSsh().getFingerprint()); } if (host.getSsh().isSetAuthenticationMethod()) { params.setAuthMethod(mapSshAuthenticationMethod(host.getSsh().getAuthenticationMethod())); } } return params; }
@Override protected VDS getInverse(VdsStatic to) { VDS inverse = new VDS(); inverse.setId(to.getId()); inverse.setVdsName(to.getName()); inverse.setHostName(to.getHostName()); inverse.setClusterId(to.getClusterId()); inverse.setPort(to.getPort()); inverse.setSshKeyFingerprint(to.getSshKeyFingerprint()); inverse.setHostProviderId(to.getHostProviderId()); inverse.setSshPort(to.getSshPort()); inverse.setSshUsername(to.getSshUsername()); inverse.setVdsSpmPriority(to.getVdsSpmPriority()); inverse.setConsoleAddress(to.getConsoleAddress()); inverse.setComment(to.getComment()); return inverse; }
params.getvds().setSshUsername(action.getSsh().getUser().getUserName());
private static Object cloneVDS(VDS instance) { VDS obj = new VDS(); obj.setHostName(instance.getHostName()); obj.setSshKeyFingerprint(instance.getSshKeyFingerprint()); obj.setSshPort(instance.getSshPort()); obj.setSshUsername(instance.getSshUsername()); obj.setFenceAgents(cloneAgents(instance.getFenceAgents())); obj.setDisablePowerManagementPolicy(instance.isDisablePowerManagementPolicy()); obj.setPmKdumpDetection(instance.isPmKdumpDetection()); obj.setPort(instance.getPort()); obj.setServerSslEnabled(instance.isServerSslEnabled()); obj.setClusterId(instance.getClusterId()); obj.setId(instance.getId()); obj.setVdsName(instance.getName()); obj.setVdsStrength(instance.getVdsStrength()); obj.setVdsType(instance.getVdsType()); obj.setUniqueId(instance.getUniqueId()); obj.setVdsSpmPriority(instance.getVdsSpmPriority()); obj.setCurrentKernelCmdline(instance.getCurrentKernelCmdline()); obj.setKernelCmdlineParsable(instance.isKernelCmdlineParsable()); obj.setLastStoredKernelCmdline(instance.getLastStoredKernelCmdline()); obj.setKernelCmdlineBlacklistNouveau(instance.isKernelCmdlineBlacklistNouveau()); obj.setKernelCmdlineIommu(instance.isKernelCmdlineIommu()); obj.setKernelCmdlineKvmNested(instance.isKernelCmdlineKvmNested()); obj.setKernelCmdlinePciRealloc(instance.isKernelCmdlinePciRealloc()); obj.setKernelCmdlineFips(instance.isKernelCmdlineFips()); obj.setKernelCmdlineUnsafeInterrupts(instance.isKernelCmdlineUnsafeInterrupts()); return obj; }
host.setPort(model.getPort().getEntity()); host.setSshPort(model.getAuthSshPort().getEntity()); host.setSshUsername(model.getUserName().getEntity()); host.setSshKeyFingerprint(model.getFetchSshFingerprint().getEntity()); host.setClusterId(model.getCluster().getSelectedItem().getId());
host.setPort(model.getPort().getEntity()); host.setSshPort(model.getAuthSshPort().getEntity()); host.setSshUsername(model.getUserName().getEntity()); host.setSshKeyFingerprint(model.getFetchSshFingerprint().getEntity()); host.setClusterId(model.getCluster().getSelectedItem().getId());
host.setSshPort(Integer.parseInt(model.getAuthSshPort().getEntity().toString())); boolean sshUsernameSet = model.getUserName().getEntity() != null; host.setSshUsername(sshUsernameSet ? model.getUserName().getEntity() : null); boolean sshFpSet = model.getFetchSshFingerprint().getEntity() != null; host.setSshKeyFingerprint(!sshFpSet ? null : model.getFetchSshFingerprint().getEntity());
vds.setPort(getPort()); vds.setSshPort(getSshPort()); vds.setSshUsername(getSshUsername()); vds.setStatus(getStatus()); vds.setExternalStatus(getExternalStatus());