I'm searching through the javadocs and I can't seem to find something that allows me to authorize a given unauthorized node using groovy scripting. Is this allowed? If not, is there a REST equivalent?
Thanks,
Tom Z.
I'm searching through the javadocs and I can't seem to find something that allows me to authorize a given unauthorized node using groovy scripting. Is this allowed? If not, is there a REST equivalent?
Thanks,
Tom Z.
This can be done by running below groovy script:
groovy:
import com.pmease.quickbuild.model.Token;
import com.pmease.quickbuild.entitymanager.TokenManager;
import java.util.UUID;
Token token = new Token();
token.setIp(ip);
token.setPort(port);
token.setHostName("<Unknown>");
token.setValue(UUID.randomUUID().toString());
TokenManager.instance.save(token);
This code has weird behavior. If I attempt to use those hosts as GridNode objects later in the groovy script, they throw errors, and the Active and Unauthorized nodes both contain the same object names!
It may take a while for node to become active, just polling grid.getNode(hostname) to be non-null and continue with your logic.