/**
* Generate a new token and get the result page (which is the html page of the user's profile)
*
* @param username - mandatory
* @return an {@link InputStream} instance, not linked to any network resources - won't be null
* @throws RundeckApiException in case of error when calling the API (non-existent name or project with this name)
* @throws RundeckApiLoginException if the login fails (in case of login-based authentication)
* @throws RundeckApiTokenException if the token is invalid (in case of token-based authentication)
* @throws IllegalArgumentException if the name or project is blank (null, empty or whitespace)
*/
public InputStream generateToken(String username) throws RundeckApiException, RundeckApiLoginException,
RundeckApiTokenException, IllegalArgumentException {
AssertUtil.notBlank(username, "the username is mandatory to generate the token");
return new ApiCall(this).getNonApi(new ApiPathBuilder("/user/generateApiToken?login=", username));
}
I can defer to Greg to see if this method is part of v5 and if so, will be part of an upcoming Rundeck 1.4.4 release.
Chuck