hudson.plugins.ec2
Class EC2Computer

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.Actionable
          extended by hudson.model.Computer
              extended by hudson.slaves.SlaveComputer
                  extended by hudson.plugins.ec2.EC2Computer
All Implemented Interfaces:
hudson.model.ExecutorListener, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, hudson.security.AccessControlled

public class EC2Computer
extends hudson.slaves.SlaveComputer

Author:
Kohsuke Kawaguchi

Field Summary
 
Fields inherited from class hudson.model.Computer
CONFIGURE, DELETE, nodeName, offlineCause, PERMISSIONS, threadPoolForRemoting
 
Constructor Summary
EC2Computer(EC2Slave slave)
           
 
Method Summary
 com.xerox.amazonws.ec2.ReservationDescription.Instance describeInstance()
          Obtains the instance state description in EC2.
 org.kohsuke.stapler.HttpResponse doDoDelete()
          When the slave is deleted, terminate the instance.
 java.lang.String getConsoleOutput()
          Gets the EC2 console output.
 java.lang.String getInstanceId()
           
 EC2Slave getNode()
           
 java.lang.String getRemoteAdmin()
          What username to use to run root-like commands
 java.lang.String getRootCommandPrefix()
           
 InstanceState getState()
          Gets the current state of the instance.
 long getUptime()
          Number of milli-secs since the instance was started.
 java.lang.String getUptimeString()
          Returns uptime in the human readable form.
 
Methods inherited from class hudson.slaves.SlaveComputer
_connect, disconnect, doDoDisconnect, doLaunchSlaveAgent, getChannel, getDefaultCharset, getIcon, getJnlpJars, getLauncher, getLogRecords, getRetentionStrategy, grabLauncher, isAcceptingTasks, isConnecting, isJnlpAgent, isLaunchSupported, isUnix, kill, openLogFile, setAcceptingTasks, setChannel, setChannel, setNode, taskAccepted, taskCompleted, taskCompletedWithProblems, tryReconnect
 
Methods inherited from class hudson.model.Computer
_doScript, checkPermission, cliConnect, cliDisconnect, cliOffline, cliOnline, connect, countBusy, countExecutors, countIdle, currentComputer, disconnect, doConfigSubmit, doDumpExportTable, doProgressiveLog, doRssAll, doRssFailed, doScript, doScriptText, doToggleOffline, getACL, getApi, getBuilds, getCaption, getConnectTime, getDemandStartMilliseconds, getDisplayName, getEnvironment, getEnvVars, getExecutors, getHostName, getIconAltText, getIdleStartMilliseconds, getLoadStatistics, getLog, getLogFile, getMonitorData, getName, getNumExecutors, getOfflineCause, getOneOffExecutors, getSearchUrl, getSystemProperties, getThreadDump, getTiedJobs, getUrl, getWorkspaceList, hasPermission, interrupt, isIdle, isManualLaunchAllowed, isOffline, isOnline, isTemporarilyOffline, launch, setTemporarilyOffline, setTemporarilyOffline
 
Methods inherited from class hudson.model.Actionable
addAction, getAction, getAction, getActions, getActions, getDynamic
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EC2Computer

public EC2Computer(EC2Slave slave)
Method Detail

getNode

public EC2Slave getNode()
Overrides:
getNode in class hudson.slaves.SlaveComputer

getInstanceId

public java.lang.String getInstanceId()

getConsoleOutput

public java.lang.String getConsoleOutput()
                                  throws com.xerox.amazonws.ec2.EC2Exception
Gets the EC2 console output.

Throws:
com.xerox.amazonws.ec2.EC2Exception

describeInstance

public com.xerox.amazonws.ec2.ReservationDescription.Instance describeInstance()
                                                                        throws com.xerox.amazonws.ec2.EC2Exception
Obtains the instance state description in EC2.

This method returns a cached state, so it's not suitable to check ReservationDescription.Instance.getState() and ReservationDescription.Instance.getStateCode() from the returned instance (but all the other fields are valid as it won't change.)

Throws:
com.xerox.amazonws.ec2.EC2Exception

getState

public InstanceState getState()
                       throws com.xerox.amazonws.ec2.EC2Exception
Gets the current state of the instance.

Unlike describeInstance(), this method always return the current status by calling EC2.

Throws:
com.xerox.amazonws.ec2.EC2Exception

getUptime

public long getUptime()
               throws com.xerox.amazonws.ec2.EC2Exception
Number of milli-secs since the instance was started.

Throws:
com.xerox.amazonws.ec2.EC2Exception

getUptimeString

public java.lang.String getUptimeString()
                                 throws com.xerox.amazonws.ec2.EC2Exception
Returns uptime in the human readable form.

Throws:
com.xerox.amazonws.ec2.EC2Exception

doDoDelete

public org.kohsuke.stapler.HttpResponse doDoDelete()
                                            throws java.io.IOException
When the slave is deleted, terminate the instance.

Overrides:
doDoDelete in class hudson.model.Computer
Throws:
java.io.IOException

getRemoteAdmin

public java.lang.String getRemoteAdmin()
What username to use to run root-like commands


getRootCommandPrefix

public java.lang.String getRootCommandPrefix()


Copyright © 2010. All Rights Reserved.