public class SlaveTemplate extends Object implements hudson.model.Describable<SlaveTemplate>
SlaveTemplate represents the configuration values for creating a new slave via a DigitalOcean droplet.
Holds things like Image ID, sizeId and region used for the specific droplet.
The provision(String, String, String, String, Integer) method
is the main entry point to create a new droplet via the DigitalOcean API when a new slave needs to be provisioned.
| Modifier and Type | Class and Description |
|---|---|
static class |
SlaveTemplate.DescriptorImpl |
| Constructor and Description |
|---|
SlaveTemplate(String name,
String imageId,
String sizeId,
String regionId,
String username,
String workspacePath,
Integer sshPort,
String idleTerminationInMinutes,
String numExecutors,
String labelString,
String instanceCap,
String userData,
String initScript)
Data is injected from the global Jenkins configuration via jelly.
|
| Modifier and Type | Method and Description |
|---|---|
hudson.model.Descriptor<SlaveTemplate> |
getDescriptor() |
int |
getIdleTerminationInMinutes() |
String |
getImageId() |
String |
getInitScript() |
int |
getInstanceCap() |
String |
getLabels() |
Set<hudson.model.labels.LabelAtom> |
getLabelSet() |
String |
getLabelString() |
String |
getName() |
int |
getNumExecutors() |
String |
getRegionId() |
String |
getSizeId() |
int |
getSshPort() |
String |
getUserData() |
String |
getUsername() |
String |
getWorkspacePath() |
boolean |
isInstanceCapReached(String authToken,
String cloudName) |
Slave |
provision(String dropletName,
String cloudName,
String authToken,
String privateKey,
Integer sshKeyId) |
protected Object |
readResolve() |
@DataBoundConstructor public SlaveTemplate(String name, String imageId, String sizeId, String regionId, String username, String workspacePath, Integer sshPort, String idleTerminationInMinutes, String numExecutors, String labelString, String instanceCap, String userData, String initScript)
imageId - an image slug e.g. "debian-8-x64", or an integer e.g. of a backup, such as "12345678"sizeId - the image size e.g. "512mb" or "1gb"regionId - the region e.g. "nyc1"idleTerminationInMinutes - how long to wait before destroying a slavenumExecutors - the number of executors that this slave supportslabelString - the label for this slaveuserData - user data for DigitalOcean to apply when building the slaveinitScript - setup script to configure the slavepublic boolean isInstanceCapReached(String authToken, String cloudName) throws com.myjeeva.digitalocean.exception.RequestUnsuccessfulException, com.myjeeva.digitalocean.exception.DigitalOceanException
com.myjeeva.digitalocean.exception.RequestUnsuccessfulExceptioncom.myjeeva.digitalocean.exception.DigitalOceanExceptionpublic Slave provision(String dropletName, String cloudName, String authToken, String privateKey, Integer sshKeyId) throws IOException, com.myjeeva.digitalocean.exception.RequestUnsuccessfulException, hudson.model.Descriptor.FormException
IOExceptioncom.myjeeva.digitalocean.exception.RequestUnsuccessfulExceptionhudson.model.Descriptor.FormExceptionpublic hudson.model.Descriptor<SlaveTemplate> getDescriptor()
getDescriptor in interface hudson.model.Describable<SlaveTemplate>public String getName()
public String getSizeId()
public String getRegionId()
public String getLabels()
public String getLabelString()
public Set<hudson.model.labels.LabelAtom> getLabelSet()
public String getImageId()
public String getUsername()
public String getWorkspacePath()
public int getNumExecutors()
public int getIdleTerminationInMinutes()
public int getInstanceCap()
public String getUserData()
public String getInitScript()
public int getSshPort()
protected Object readResolve()
Copyright © 2004-2016. All Rights Reserved.