我已经阅读了很多Jenkins API文档。但我没有采用任何方法使用Python API更改Jenkins节点的细节。 基本上,这些是我想要改变的领域:
1)执行人员数量 2)标签 3)主持人
答案 0 :(得分:0)
import jenkins.model.*
import hudson.model.*
import hudson.slaves.*
import hudson.plugins.sshslaves.*
import java.util.ArrayList;
import hudson.slaves.EnvironmentVariablesNodeProperty.Entry;
Slave slave = new DumbSlave(
"agent-node","Agent node description",
"/home/jenkins",
"1",
Node.Mode.NORMAL,
"agent-node-label",
new SSHLauncher("agenNode",22,"user","password","","","","",""),
new RetentionStrategy.Always(),
new LinkedList())
Jenkins.instance.addNode(slave)