public class JCloudsSlave extends AbstractCloudSlave implements org.jenkinsci.plugins.cloudstats.TrackedItem
Modifier and Type | Class and Description |
---|---|
static class |
JCloudsSlave.JCloudsSlaveDescriptor |
Slave.JnlpJar, Slave.SlaveDescriptor
Node.InternalComputerListener, Node.Mode
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
boolean |
stopOnTerminate |
holdOffLaunchUntilSave, SKIP_BUILD_CHECK_ON_FLYWEIGHTS
Constructor and Description |
---|
JCloudsSlave(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId,
String cloudName,
String fsRoot,
NodeMetadata metadata,
String labelString,
String description,
String numExecutors,
boolean stopOnTerminate,
Integer overrideRetentionTime,
String jvmOptions,
boolean waitPhoneHome,
int waitPhoneHomeTimeout,
String credentialsId,
Node.Mode mode,
String preferredAddress,
boolean useJnlp,
boolean jnlpProvisioning,
String jnlpProvisioningNonce) |
JCloudsSlave(String cloudName,
String fsRoot,
NodeMetadata metadata,
String labelString,
String description,
String numExecutors,
boolean stopOnTerminate,
Integer overrideRetentionTime,
String jvmOptions,
boolean waitPhoneHome,
int waitPhoneHomeTimeout,
String credentialsId,
Node.Mode mode,
String preferredAddress,
boolean useJnlp,
boolean jnlpProvisioning,
String jnlpProvisioningNonce)
Constructs a new slave from JCloud's NodeMetadata
|
JCloudsSlave(String cloudName,
String name,
String nodeDescription,
String remoteFS,
String numExecutors,
Node.Mode mode,
String labelString,
ComputerLauncher launcher,
RetentionStrategy retentionStrategy,
List<? extends NodeProperty<?>> nodeProperties,
boolean stopOnTerminate,
Integer overrideRetentionTime,
String user,
String password,
String privateKey,
boolean authSudo,
String jvmOptions,
boolean waitPhoneHome,
int waitPhoneHomeTimeout,
String credentialsId,
String preferredAddress,
boolean useJnlp,
boolean jnlpProvisioning,
String jnlpProvisioningNonce) |
Modifier and Type | Method and Description |
---|---|
protected void |
_terminate(TaskListener listener)
Destroy the node.
|
AbstractCloudComputer<JCloudsSlave> |
createComputer() |
String |
getCloudName()
Get the JClouds profile identifier for the Cloud associated with this slave.
|
LoginCredentials |
getCredentials()
Get Jclouds LoginCredentials associated with this Slave.
|
String |
getCredentialsId() |
org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id |
getId() |
boolean |
getJnlpProvisioning() |
String |
getJnlpProvisioningNonce() |
String |
getJvmOptions()
Get Jclouds Custom JVM Options associated with this Slave.
|
NodeMetadata |
getNodeMetaData()
Get Jclouds NodeMetadata associated with this Slave.
|
String |
getPreferredAddress() |
int |
getRetentionTime()
Get the retention time for this slave, defaulting to the parent cloud's if not set.
|
boolean |
getUseJnlp() |
String |
handleJnlpProvisioning(String hash)
Handles JNLP provisioning request from slave.
|
boolean |
isPendingDelete() |
boolean |
isWaitPhoneHome() |
void |
publishJnlpMetaData()
Publishes JNLP metadata to the virtual machine.
|
protected Object |
readResolve() |
void |
setJnlpProvisioningNonce(String value) |
void |
setOverrideRetentionTime(Integer value) |
void |
setPendingDelete(boolean pendingDelete) |
void |
setWaitPhoneHome(boolean value) |
void |
waitForPhoneHome(PrintStream logger) |
terminate
createLauncher, equals, getClockDifferenceCallable, getComputer, getDescriptor, getLabelString, getLauncher, getMode, getNodeDescription, getNodeName, getNodeProperties, getNumExecutors, getRemoteFS, getRetentionStrategy, getRootPath, getUserId, getWorkspaceFor, getWorkspaceRoot, hashCode, setLabelString, setLauncher, setMode, setNodeDescription, setNodeName, setNodeProperties, setNumExecutors, setRetentionStrategy, setUserId, toString
canTake, canTake, createPath, getACL, getAssignedLabels, getChannel, getClockDifference, getDisplayName, getFileSystemProvisioner, getLabelCloud, getNodeProperty, getNodeProperty, getNodePropertyDescriptors, getSearchUrl, getSelfLabel, isAcceptingTasks, isHoldOffLaunchUntilSave, reconfigure, save, toComputer
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission
@DataBoundConstructor public JCloudsSlave(String cloudName, String name, String nodeDescription, String remoteFS, String numExecutors, Node.Mode mode, String labelString, ComputerLauncher launcher, RetentionStrategy retentionStrategy, List<? extends NodeProperty<?>> nodeProperties, boolean stopOnTerminate, Integer overrideRetentionTime, String user, String password, String privateKey, boolean authSudo, String jvmOptions, boolean waitPhoneHome, int waitPhoneHomeTimeout, String credentialsId, String preferredAddress, boolean useJnlp, boolean jnlpProvisioning, String jnlpProvisioningNonce) throws Descriptor.FormException, IOException
Descriptor.FormException
IOException
public JCloudsSlave(String cloudName, String fsRoot, NodeMetadata metadata, String labelString, String description, String numExecutors, boolean stopOnTerminate, Integer overrideRetentionTime, String jvmOptions, boolean waitPhoneHome, int waitPhoneHomeTimeout, String credentialsId, Node.Mode mode, String preferredAddress, boolean useJnlp, boolean jnlpProvisioning, String jnlpProvisioningNonce) throws IOException, Descriptor.FormException
cloudName
- - the name of the cloud that's provisioning this slave.fsRoot
- - Location of Jenkins root (homedir) on the slave.metadata
- - JCloudsNodeMetadatalabelString
- - Label(s) for this slave.description
- - Description of this slave.numExecutors
- - Number of executors for this slave.stopOnTerminate
- - if true
, suspend the slave rather than terminating it.overrideRetentionTime
- - Retention time to use specifically for this slave, overriding the cloud default.jvmOptions
- - Custom options for lauching the JVM on the slave.waitPhoneHome
- - if true
, delay initial SSH connect until slave has "phoned home" back to jenkins.waitPhoneHomeTimeout
- - Timeout in minutes util giving up waiting for the "phone home" POST.credentialsId
- - Id of the credentials in Jenkin's global credentials database.mode
- - Jenkins usage mode for this nodepreferredAddress
- - The preferred Address expression to connect touseJnlp
- - if true
, the final ssh connection attempt will be skipped.jnlpProvisioning
- - if true
, enables JNLP provisioning.jnlpProvisioningNonce
- - nonce, used to authenticate provisioning requests via JnlpProvisionWebHook.IOException
- if an error occurs.Descriptor.FormException
- if the form does not validate.public JCloudsSlave(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String cloudName, String fsRoot, NodeMetadata metadata, String labelString, String description, String numExecutors, boolean stopOnTerminate, Integer overrideRetentionTime, String jvmOptions, boolean waitPhoneHome, int waitPhoneHomeTimeout, String credentialsId, Node.Mode mode, String preferredAddress, boolean useJnlp, boolean jnlpProvisioning, String jnlpProvisioningNonce) throws IOException, Descriptor.FormException
IOException
Descriptor.FormException
protected Object readResolve()
readResolve
in class Slave
public String handleJnlpProvisioning(@NonNull String hash)
hash
- The authentication hash, provided in the client's requestpublic void publishJnlpMetaData()
public NodeMetadata getNodeMetaData()
NodeMetadata
public String getJvmOptions()
public String getPreferredAddress()
public boolean getJnlpProvisioning()
public boolean getUseJnlp()
public String getJnlpProvisioningNonce()
public LoginCredentials getCredentials()
If Jclouds doesn't provide credentials, use stored ones.
LoginCredentials
public void setOverrideRetentionTime(Integer value)
public int getRetentionTime()
CloudInstanceDefaults.DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES
public String getCloudName()
public boolean isPendingDelete()
public void setPendingDelete(boolean pendingDelete)
public boolean isWaitPhoneHome()
public void setWaitPhoneHome(boolean value)
public void setJnlpProvisioningNonce(String value)
public String getCredentialsId()
public AbstractCloudComputer<JCloudsSlave> createComputer()
createComputer
in class AbstractCloudSlave
@Nullable public org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id getId()
getId
in interface org.jenkinsci.plugins.cloudstats.TrackedItem
protected void _terminate(TaskListener listener) throws IOException, InterruptedException
true
, calls ComputeService.suspendNode(java.lang.String)
,
otherwise ComputeService.destroyNode(java.lang.String)
._terminate
in class AbstractCloudSlave
IOException
InterruptedException
public void waitForPhoneHome(PrintStream logger) throws InterruptedException
InterruptedException
Copyright © 2016–2021. All rights reserved.