hudson.plugins.ec2
Class SlaveTemplate

java.lang.Object
  extended by hudson.plugins.ec2.SlaveTemplate
All Implemented Interfaces:
hudson.model.Describable<SlaveTemplate>

public class SlaveTemplate
extends java.lang.Object
implements hudson.model.Describable<SlaveTemplate>

Template of EC2Slave to launch.

Author:
Kohsuke Kawaguchi

Nested Class Summary
static class SlaveTemplate.DescriptorImpl
           
 
Field Summary
 java.lang.String ami
           
 java.lang.String description
           
 java.lang.String initScript
           
 java.lang.String jvmopts
           
 java.lang.String labels
           
 java.lang.String numExecutors
           
protected  EC2Cloud parent
           
 java.lang.String remoteAdmin
           
 java.lang.String remoteFS
           
 java.lang.String rootCommandPrefix
           
 com.xerox.amazonws.ec2.InstanceType type
           
 java.lang.String userData
           
 
Constructor Summary
SlaveTemplate(java.lang.String ami, java.lang.String remoteFS, com.xerox.amazonws.ec2.InstanceType type, java.lang.String labelString, java.lang.String description, java.lang.String initScript, java.lang.String userData, java.lang.String numExecutors, java.lang.String remoteAdmin, java.lang.String rootCommandPrefix, java.lang.String jvmopts)
           
 
Method Summary
 EC2Slave attach(java.lang.String instanceId, hudson.model.TaskListener listener)
          Provisions a new EC2 slave based on the currently running instance on EC2, instead of starting a new one.
 boolean containsLabel(hudson.model.Label l)
          Does this contain the given label?
 hudson.model.Descriptor<SlaveTemplate> getDescriptor()
           
 java.lang.String getDisplayName()
           
 java.lang.String getLabelString()
           
 int getNumExecutors()
           
 EC2Cloud getParent()
           
 java.lang.String getRemoteAdmin()
           
 java.lang.String getRootCommandPrefix()
           
 EC2Slave provision(hudson.model.TaskListener listener)
          Provisions a new EC2 slave.
protected  java.lang.Object readResolve()
          Initializes data structure that we don't persist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ami

public final java.lang.String ami

description

public final java.lang.String description

remoteFS

public final java.lang.String remoteFS

type

public final com.xerox.amazonws.ec2.InstanceType type

labels

public final java.lang.String labels

initScript

public final java.lang.String initScript

userData

public final java.lang.String userData

numExecutors

public final java.lang.String numExecutors

remoteAdmin

public final java.lang.String remoteAdmin

rootCommandPrefix

public final java.lang.String rootCommandPrefix

jvmopts

public final java.lang.String jvmopts

parent

protected transient EC2Cloud parent
Constructor Detail

SlaveTemplate

@DataBoundConstructor
public SlaveTemplate(java.lang.String ami,
                                          java.lang.String remoteFS,
                                          com.xerox.amazonws.ec2.InstanceType type,
                                          java.lang.String labelString,
                                          java.lang.String description,
                                          java.lang.String initScript,
                                          java.lang.String userData,
                                          java.lang.String numExecutors,
                                          java.lang.String remoteAdmin,
                                          java.lang.String rootCommandPrefix,
                                          java.lang.String jvmopts)
Method Detail

getParent

public EC2Cloud getParent()

getLabelString

public java.lang.String getLabelString()

getDisplayName

public java.lang.String getDisplayName()

getNumExecutors

public int getNumExecutors()

getRemoteAdmin

public java.lang.String getRemoteAdmin()

getRootCommandPrefix

public java.lang.String getRootCommandPrefix()

containsLabel

public boolean containsLabel(hudson.model.Label l)
Does this contain the given label?

Parameters:
l - can be null to indicate "don't care".

provision

public EC2Slave provision(hudson.model.TaskListener listener)
                   throws com.xerox.amazonws.ec2.EC2Exception,
                          java.io.IOException
Provisions a new EC2 slave.

Returns:
always non-null. This needs to be then added to Hudson.addNode(Node).
Throws:
com.xerox.amazonws.ec2.EC2Exception
java.io.IOException

attach

public EC2Slave attach(java.lang.String instanceId,
                       hudson.model.TaskListener listener)
                throws com.xerox.amazonws.ec2.EC2Exception,
                       java.io.IOException
Provisions a new EC2 slave based on the currently running instance on EC2, instead of starting a new one.

Throws:
com.xerox.amazonws.ec2.EC2Exception
java.io.IOException

readResolve

protected java.lang.Object readResolve()
Initializes data structure that we don't persist.


getDescriptor

public hudson.model.Descriptor<SlaveTemplate> getDescriptor()
Specified by:
getDescriptor in interface hudson.model.Describable<SlaveTemplate>


Copyright © 2010. All Rights Reserved.