@Override public Response approve(Action action) { if (action.isSetCluster() && (action.getCluster().isSetId() || action.getCluster().isSetName())) { update(setCluster(get(), action.getCluster())); } ApproveVdsParameters params = new ApproveVdsParameters(guid); params = (ApproveVdsParameters) getMapper (Action.class, VdsOperationActionParameters.class).map(action, params); // Set pk authentication as default params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.PublicKey); if (action.isSetRootPassword()) { params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.Password); params.setRootPassword(action.getRootPassword()); } else if (action.isSetSsh() && action.getSsh().isSetAuthenticationMethod()) { if (action.getSsh().getAuthenticationMethod() == SshAuthenticationMethod.PASSWORD) { params.setAuthMethod(VdsOperationActionParameters.AuthenticationMethod.Password); if (action.getSsh().isSetUser() && action.getSsh().getUser().isSetPassword()) { params.setPassword(action.getSsh().getUser().getPassword()); } } } // by default activate the host after approval boolean activate = ParametersHelper.getBooleanParameter(httpHeaders, uriInfo, BackendHostsResource.ACTIVATE, true, true); params.setActivateHost(activate); return doAction(ActionType.ApproveVds, params, action); }
to.setNamespace(from.getNamespace()); if (from.isSetPassword()) { to.setPassword(from.getPassword());
@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; }
if (action.isSetSsh()) { if (action.getSsh().isSetUser()) { if (action.getSsh().getUser().isSetPassword()) {
params.setSysPrepUserName(vm.getDomain().getUser().getUserName()); if (vm.getDomain().getUser().isSetPassword()) { params.setSysPrepPassword(vm.getDomain().getUser().getPassword());