public class JenkinsServer extends Object
| Constructor and Description |
|---|
JenkinsServer(JenkinsHttpClient client)
Create a new Jenkins server directly from an HTTP client (ADVANCED)
|
JenkinsServer(URI serverUri)
Create a new Jenkins server reference given only the server address
|
JenkinsServer(URI serverUri,
String username,
String passwordOrToken)
Create a new Jenkins server reference given the address and credentials
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStringParam(String jobName,
String name,
String description,
String defaultValue) |
void |
createJob(String jobName,
String jobXml)
Create a job on the server using the provided xml
|
void |
deleteJob(String jobName) |
Map<String,Computer> |
getComputers()
Get a list of all the computers on the server (at the summary level)
|
JobWithDetails |
getJob(String jobName)
Get a single Job from the server.
|
Map<String,Job> |
getJobs()
Get a list of all the defined jobs on the server (at the summary level)
|
Map<String,Job> |
getJobs(String view)
Get a list of all the defined jobs on the server (at the specified view level)
|
String |
getJobXml(String jobName)
Get the xml description of an existing job
|
LabelWithDetails |
getLabel(String labelName)
Get the description of an existing Label
|
MavenJobWithDetails |
getMavenJob(String jobName) |
View |
getView(String name)
Get a single view object from the server
|
boolean |
isRunning()
Get the current status of the Jenkins end-point by pinging it.
|
void |
updateJob(String jobName,
String jobXml)
Update the xml description of an existing job
|
void |
updateJob(String jobName,
String jobXml,
boolean crumbFlag) |
public JenkinsServer(URI serverUri)
serverUri - address of jenkins server (ex. http://localhost:8080/jenkins)public JenkinsServer(URI serverUri, String username, String passwordOrToken)
serverUri - address of jenkins server (ex. http://localhost:8080/jenkins)username - username to use when connectingpasswordOrToken - password (not recommended) or token (recommended)public JenkinsServer(JenkinsHttpClient client)
client - Specialized client to use.public boolean isRunning()
public Map<String,Job> getJobs() throws IOException
IOExceptionpublic View getView(String name) throws IOException
name - name of the view in JenkinsIOExceptionpublic Map<String,Job> getJobs(String view) throws IOException
IOExceptionpublic JobWithDetails getJob(String jobName) throws IOException
IOExceptionpublic MavenJobWithDetails getMavenJob(String jobName) throws IOException
IOExceptionpublic void createJob(String jobName, String jobXml) throws IOException
IOExceptionpublic String getJobXml(String jobName) throws IOException
IOExceptionpublic LabelWithDetails getLabel(String labelName) throws IOException
IOExceptionpublic Map<String,Computer> getComputers() throws IOException
IOExceptionpublic void updateJob(String jobName, String jobXml) throws IOException
IOExceptionpublic void updateJob(String jobName, String jobXml, boolean crumbFlag) throws IOException
IOExceptionpublic void addStringParam(String jobName, String name, String description, String defaultValue) throws IOException, JAXBException, org.dom4j.DocumentException
IOExceptionJAXBExceptionorg.dom4j.DocumentExceptionpublic void deleteJob(String jobName) throws IOException
IOExceptionCopyright © 2015. All Rights Reserved.