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(DigitalOceanClient, String, String, Integer, StreamTaskListener) 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 imageId,
String sizeId,
String regionId,
String idleTerminationInMinutes,
String numExecutors,
String labelString,
String userData,
String initScript)
Data is injected from the global Jenkins configuration via jelly.
|
| Modifier and Type | Method and Description |
|---|---|
String |
createDropletName() |
hudson.model.Descriptor<SlaveTemplate> |
getDescriptor() |
int |
getIdleTerminationInMinutes() |
String |
getImageId() |
String |
getInitScript() |
String |
getLabels() |
Set<hudson.model.labels.LabelAtom> |
getLabelSet() |
String |
getLabelString() |
int |
getNumExecutors() |
Cloud |
getParent() |
String |
getRegionId() |
String |
getSizeId() |
String |
getUserData() |
Slave |
provision(com.myjeeva.digitalocean.impl.DigitalOceanClient apiClient,
String dropletName,
String privateKey,
Integer sshKeyId,
hudson.util.StreamTaskListener listener)
Creates a new droplet on DigitalOcean to be used as a Jenkins slave.
|
protected Object |
readResolve() |
protected transient Cloud parent
@DataBoundConstructor public SlaveTemplate(String imageId, String sizeId, String regionId, String idleTerminationInMinutes, String numExecutors, String labelString, String userData, String initScript)
imageId - an image id e.g. "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 Slave provision(com.myjeeva.digitalocean.impl.DigitalOceanClient apiClient, String dropletName, String privateKey, Integer sshKeyId, hudson.util.StreamTaskListener listener) throws IOException, com.myjeeva.digitalocean.exception.RequestUnsuccessfulException, hudson.model.Descriptor.FormException
apiClient - the v2 API client to useprivateKey - the RSA private key to usesshKeyId - the SSH key name name to uselistener - the listener on which to report progressSlaveIOExceptioncom.myjeeva.digitalocean.exception.RequestUnsuccessfulExceptionDescriptor.FormExceptionpublic hudson.model.Descriptor<SlaveTemplate> getDescriptor()
getDescriptor in interface hudson.model.Describable<SlaveTemplate>public String createDropletName()
public String getSizeId()
public String getRegionId()
public String getLabels()
public String getLabelString()
public Set<hudson.model.labels.LabelAtom> getLabelSet()
public Cloud getParent()
public String getImageId()
public int getNumExecutors()
public int getIdleTerminationInMinutes()
public String getUserData()
public String getInitScript()
protected Object readResolve()
Copyright © 2004-2015. All Rights Reserved.