org.jenkinsci.plugins.rundeck.domain
Class RundeckInstance

java.lang.Object
  extended by org.jenkinsci.plugins.rundeck.domain.RundeckInstance
All Implemented Interfaces:
Serializable

public class RundeckInstance
extends Object
implements Serializable

Represents a RunDeck instance, and allows to communicate with it. Uses RunDeck 1.2 "WebApi" (version 1).

Author:
Vincent Behar
See Also:
Serialized Form

Constructor Summary
RundeckInstance(String url, String login, String password)
          Build a new RunDeck instance
 
Method Summary
 boolean equals(Object obj)
           
 RundeckExecution getExecution(Long executionId)
          Get the details of a job execution, identified by the given id.
 RundeckJob getJob(String jobId)
          Get the details of a job, identified by the given id.
 String getLogin()
           
 String getPassword()
           
 String getUrl()
           
 int hashCode()
           
 boolean isAlive()
           
 boolean isConfigurationValid()
           
 boolean isLoginValid()
           
 RundeckExecution runJob(String jobId, Properties options)
          Run a job, identified by the given id.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RundeckInstance

public RundeckInstance(String url,
                       String login,
                       String password)
Build a new RunDeck instance

Parameters:
url - of the RunDeck server (http://localhost:4440)
login - to use
password - associated with the login
Method Detail

isConfigurationValid

public boolean isConfigurationValid()
Returns:
true if the configuration is valid, false otherwise

isAlive

public boolean isAlive()
Returns:
true if this RunDeck instance is alive, false otherwise

isLoginValid

public boolean isLoginValid()
Returns:
true if the credentials (login/password) are valid, false otherwise

getJob

public RundeckJob getJob(String jobId)
                  throws RundeckApiException,
                         RundeckApiException.RundeckApiLoginException
Get the details of a job, identified by the given id.

Parameters:
jobId - - mandatory
Returns:
a RundeckJob instance (won't be null), with details on the job
Throws:
RundeckApiException - in case of error calling the API
RundeckApiException.RundeckApiLoginException - if the login failed

getExecution

public RundeckExecution getExecution(Long executionId)
                              throws RundeckApiException,
                                     RundeckApiException.RundeckApiLoginException
Get the details of a job execution, identified by the given id.

Parameters:
executionId - - mandatory
Returns:
a RundeckExecution instance (won't be null), with details on the execution
Throws:
RundeckApiException - in case of error calling the API
RundeckApiException.RundeckApiLoginException - if the login failed

runJob

public RundeckExecution runJob(String jobId,
                               Properties options)
                        throws RundeckApiException,
                               RundeckApiException.RundeckApiLoginException,
                               RundeckApiException.RundeckApiJobRunException
Run a job, identified by the given id.

Parameters:
jobId - - mandatory
options - for the job, optional
Returns:
a RundeckExecution instance (won't be null), with details on the execution
Throws:
RundeckApiException.RundeckApiLoginException - if the login failed
RundeckApiException.RundeckApiJobRunException - if the run failed
RundeckApiException - in case of error calling the API

getUrl

public String getUrl()

getLogin

public String getLogin()

getPassword

public String getPassword()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2004-2011. All Rights Reserved.