Class EC2Computer

All Implemented Interfaces:
ExtensionPoint, DescriptorByNameOwner, ExecutorListener, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu, HasWidgets, org.kohsuke.stapler.StaplerProxy

public class EC2Computer extends SlaveComputer
Author:
Kohsuke Kawaguchi
  • Constructor Details

  • Method Details

    • getNode

      public EC2AbstractSlave getNode()
      Overrides:
      getNode in class SlaveComputer
    • getInstanceId

      @CheckForNull public String getInstanceId()
    • getEc2Type

      public String getEc2Type()
    • getSpotInstanceRequestId

      public String getSpotInstanceRequestId()
    • getCloud

      public EC2Cloud getCloud()
    • getSlaveTemplate

      @CheckForNull public SlaveTemplate getSlaveTemplate()
    • getConsoleOutput

      public String getConsoleOutput() throws com.amazonaws.AmazonClientException
      Gets the EC2 console output.
      Throws:
      com.amazonaws.AmazonClientException
    • getDecodedConsoleOutput

      public String getDecodedConsoleOutput() throws com.amazonaws.AmazonClientException
      Gets the EC2 decoded console output.
      Throws:
      com.amazonaws.AmazonClientException
      Since:
      TODO
    • describeInstance

      public com.amazonaws.services.ec2.model.Instance describeInstance() throws com.amazonaws.AmazonClientException, InterruptedException
      Obtains the instance state description in EC2.

      This method returns a cached state, so it's not suitable to check Instance.getState() from the returned instance (but all the other fields are valid as it won't change.) The cache can be flushed using updateInstanceDescription()

      Throws:
      com.amazonaws.AmazonClientException
      InterruptedException
    • updateInstanceDescription

      public com.amazonaws.services.ec2.model.Instance updateInstanceDescription() throws com.amazonaws.AmazonClientException, InterruptedException
      This will flush any cached description held by describeInstance().
      Throws:
      com.amazonaws.AmazonClientException
      InterruptedException
    • getState

      public InstanceState getState() throws com.amazonaws.AmazonClientException, InterruptedException
      Gets the current state of the instance.

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

      Throws:
      com.amazonaws.AmazonClientException
      InterruptedException
    • getUptime

      public long getUptime() throws com.amazonaws.AmazonClientException, InterruptedException
      Number of milli-secs since the instance was started.
      Throws:
      com.amazonaws.AmazonClientException
      InterruptedException
    • getUptimeString

      public String getUptimeString() throws com.amazonaws.AmazonClientException, InterruptedException
      Returns uptime in the human readable form.
      Throws:
      com.amazonaws.AmazonClientException
      InterruptedException
    • getLaunchTime

      public long getLaunchTime() throws InterruptedException
      Return the time this instance was launched in ms since the epoch.
      Returns:
      Time this instance was launched, in ms since the epoch.
      Throws:
      InterruptedException
    • doDoDelete

      @POST public org.kohsuke.stapler.HttpResponse doDoDelete() throws IOException
      When the agent is deleted, terminate the instance.
      Overrides:
      doDoDelete in class Computer
      Throws:
      IOException
    • getRemoteAdmin

      @CheckForNull public String getRemoteAdmin()
      What username to use to run root-like commands
      Returns:
      remote admin or null if the associated Node is null
    • getSshPort

      public int getSshPort()
    • getRootCommandPrefix

      public String getRootCommandPrefix()
    • getSlaveCommandPrefix

      public String getSlaveCommandPrefix()
    • getSlaveCommandSuffix

      public String getSlaveCommandSuffix()
    • onConnected

      public void onConnected()