Package hudson.plugins.ec2
Class EC2AbstractSlave
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Node
hudson.model.Slave
hudson.plugins.ec2.EC2AbstractSlave
- All Implemented Interfaces:
ExtensionPoint
,Describable<Node>
,ModelObject
,PersistenceRoot
,ReconfigurableDescribable<Node>
,Saveable
,SearchableModelObject
,SearchItem
,AccessControlled
,Serializable
,OnMaster
- Direct Known Subclasses:
EC2OndemandSlave
,EC2SpotSlave
Agent running on EC2.
- Author:
- Kohsuke Kawaguchi
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class hudson.model.Slave
Slave.JnlpJar, Slave.SlaveDescriptor
Nested classes/interfaces inherited from class hudson.model.Node
Node.InternalComputerListener, Node.Mode
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal String
static final String
static final Boolean
static final Integer
static final Boolean
static final Boolean
final String
final String
Comes fromSlaveTemplate.initScript
.protected String
boolean
final String
final String
protected com.amazonaws.services.ec2.model.Instance
protected long
protected final int
int
protected static final long
final String
Deprecated.protected int
Deprecated.final boolean
final String
final Tenancy
protected ResettableCountDownLatch
Terminate was scheduledstatic final String
final String
boolean
Deprecated.boolean
Deprecated.Fields inherited from class hudson.model.Node
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS
-
Constructor Summary
ConstructorsConstructorDescriptionEC2AbstractSlave
(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean usePrivateDnsName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType) Deprecated.EC2AbstractSlave
(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) Deprecated.EC2AbstractSlave
(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy) Deprecated.EC2AbstractSlave
(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String javaPath, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy, Boolean metadataEndpointEnabled, Boolean metadataTokensRequired, Integer metadataHopsLimit) Deprecated.EC2AbstractSlave
(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String javaPath, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy, Boolean metadataEndpointEnabled, Boolean metadataTokensRequired, Integer metadataHopsLimit, Boolean metadataSupported) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
static ListBoxModel
fillZoneItems
(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, String region) int
getCloud()
long
abstract String
static com.amazonaws.services.ec2.model.Instance
getInstance
(String instanceId, EC2Cloud cloud) Returns view of AWS EC2 Instance.EC2 instance ID.long
int
boolean
getTags()
boolean
Deprecated.boolean
protected boolean
isAlive
(boolean force) boolean
boolean
boolean
void
Called when the agent is connected to Jenkinsprotected void
protected Object
reconfigure
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form) abstract void
Terminates the instance in EC2.Methods inherited from class hudson.model.Slave
createLauncher, equals, getClockDifferenceCallable, getComputer, getDescriptor, getLabelAtomSet, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId, toString
Methods inherited from class hudson.model.Node
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getConfigFile, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getRootDir, getSearchUrl, getSelfLabel, getTemporaryOfflineCause, isHoldOffLaunchUntilSave, onLoad, save, toComputer
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, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
-
Field Details
-
DEFAULT_METADATA_SUPPORTED
-
DEFAULT_METADATA_ENDPOINT_ENABLED
-
DEFAULT_METADATA_TOKENS_REQUIRED
-
DEFAULT_METADATA_HOPS_LIMIT
-
DEFAULT_JAVA_PATH
- See Also:
-
instanceId
-
initScript
Comes fromSlaveTemplate.initScript
. -
tmpDir
-
remoteAdmin
-
templateDescription
-
javaPath
-
jvmopts
-
stopOnTerminate
public final boolean stopOnTerminate -
idleTerminationMinutes
-
useDedicatedTenancy
Deprecated. -
isConnected
public boolean isConnected -
tags
-
cloudName
-
amiType
-
maxTotalUses
public int maxTotalUses -
tenancy
-
publicDNS
-
privateDNS
-
lastFetchInstance
protected transient com.amazonaws.services.ec2.model.Instance lastFetchInstance -
lastFetchTime
protected transient long lastFetchTime -
terminateScheduled
Terminate was scheduled -
MIN_FETCH_TIME
protected static final long MIN_FETCH_TIME -
launchTimeout
protected final int launchTimeout -
sshPort
Deprecated. -
rootCommandPrefix
Deprecated. -
usePrivateDnsName
Deprecated. -
slaveCommandPrefix
-
slaveCommandSuffix
-
TEST_ZONE
- See Also:
-
-
Constructor Details
-
EC2AbstractSlave
public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String javaPath, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy, Boolean metadataEndpointEnabled, Boolean metadataTokensRequired, Integer metadataHopsLimit, Boolean metadataSupported) throws Descriptor.FormException, IOException - Throws:
Descriptor.FormException
IOException
-
EC2AbstractSlave
@Deprecated public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String javaPath, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy, Boolean metadataEndpointEnabled, Boolean metadataTokensRequired, Integer metadataHopsLimit) throws Descriptor.FormException, IOException Deprecated.- Throws:
Descriptor.FormException
IOException
-
EC2AbstractSlave
@Deprecated public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses, Tenancy tenancy) throws Descriptor.FormException, IOException Deprecated.- Throws:
Descriptor.FormException
IOException
-
EC2AbstractSlave
@Deprecated public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType, ConnectionStrategy connectionStrategy, int maxTotalUses) throws Descriptor.FormException, IOException Deprecated.- Throws:
Descriptor.FormException
IOException
-
EC2AbstractSlave
@Deprecated public EC2AbstractSlave(String name, String instanceId, String templateDescription, String remoteFS, int numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy<EC2Computer> retentionStrategy, String initScript, String tmpDir, List<? extends NodeProperty<?>> nodeProperties, String remoteAdmin, String jvmopts, boolean stopOnTerminate, String idleTerminationMinutes, List<EC2Tag> tags, String cloudName, boolean usePrivateDnsName, boolean useDedicatedTenancy, int launchTimeout, AMITypeData amiType) throws Descriptor.FormException, IOException Deprecated.- Throws:
Descriptor.FormException
IOException
-
-
Method Details
-
readResolve
- Overrides:
readResolve
in classSlave
-
getCloud
-
getInstanceId
EC2 instance ID. -
createComputer
- Overrides:
createComputer
in classSlave
-
getInstance
public static com.amazonaws.services.ec2.model.Instance getInstance(String instanceId, EC2Cloud cloud) Returns view of AWS EC2 Instance.- Parameters:
instanceId
- instance id.cloud
- cloud provider (EC2Cloud compatible).- Returns:
- instance in EC2.
-
terminate
public abstract void terminate()Terminates the instance in EC2. -
reconfigure
public Node reconfigure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject form) throws Descriptor.FormException - Specified by:
reconfigure
in interfaceReconfigurableDescribable<Node>
- Overrides:
reconfigure
in classNode
- Throws:
Descriptor.FormException
-
isAcceptingTasks
public boolean isAcceptingTasks()- Overrides:
isAcceptingTasks
in classNode
-
getLaunchTimeoutInMillis
public long getLaunchTimeoutInMillis() -
getRemoteAdmin
-
getSshPort
public int getSshPort() -
getStopOnTerminate
public boolean getStopOnTerminate() -
onConnected
public void onConnected()Called when the agent is connected to Jenkins -
isAlive
protected boolean isAlive(boolean force) -
clearLiveInstancedata
protected void clearLiveInstancedata() throws com.amazonaws.AmazonClientException- Throws:
com.amazonaws.AmazonClientException
-
pushLiveInstancedata
protected void pushLiveInstancedata() throws com.amazonaws.AmazonClientException- Throws:
com.amazonaws.AmazonClientException
-
getPublicDNS
-
getPrivateDNS
-
getInstanceType
-
getTags
-
getCreatedTime
public long getCreatedTime() -
getUsePrivateDnsName
Deprecated. -
getAdminPassword
-
isUseHTTPS
public boolean isUseHTTPS() -
getBootDelay
public int getBootDelay() -
getMetadataSupported
-
getMetadataEndpointEnabled
-
getMetadataTokensRequired
-
getMetadataHopsLimit
-
isSpecifyPassword
public boolean isSpecifyPassword() -
isAllowSelfSignedCertificate
public boolean isAllowSelfSignedCertificate() -
fillZoneItems
public static ListBoxModel fillZoneItems(com.amazonaws.auth.AWSCredentialsProvider credentialsProvider, String region) -
getEc2Type
-