public class SlaveTemplate extends Object implements Describable<SlaveTemplate>
SlaveTemplate
represents the configuration values for creating a new agent via a DigitalOcean droplet.
Holds things like Image ID, sizeId and region used for the specific droplet.
The provision(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Integer, java.util.List<com.myjeeva.digitalocean.pojo.Droplet>, java.lang.Boolean)
method
is the main entry point to create a new droplet via the DigitalOcean API when a new agent 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,
Boolean setupPrivateNetworking,
String idleTerminationInMinutes,
String numExecutors,
String labelString,
Boolean labellessJobsAllowed,
String instanceCap,
Boolean installMonitoring,
String tags,
String userData,
String initScript)
Data is injected from the global Jenkins configuration via jelly.
|
@DataBoundConstructor public SlaveTemplate(String name, String imageId, String sizeId, String regionId, String username, String workspacePath, Integer sshPort, Boolean setupPrivateNetworking, String idleTerminationInMinutes, String numExecutors, String labelString, Boolean labellessJobsAllowed, String instanceCap, Boolean installMonitoring, String tags, String userData, String initScript)
name
- image nameimageId
- 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"username
- username to loginworkspacePath
- path to the workspacesshPort
- ssh port to be usedidleTerminationInMinutes
- how long to wait before destroying a agentnumExecutors
- the number of executors that this agent supportslabelString
- the label for this agentlabellessJobsAllowed
- if jobs without a label are allowedinstanceCap
- if the number of created instances is cappedinstallMonitoring
- whether expanded monitoring tool agent should be installedtags
- the droplet tagsuserData
- user data for DigitalOcean to apply when building the agentinitScript
- setup script to configure the agentpublic boolean isInstanceCapReachedLocal(String cloudName)
public boolean isInstanceCapReachedRemote(List<com.myjeeva.digitalocean.pojo.Droplet> droplets, String cloudName) throws com.myjeeva.digitalocean.exception.DigitalOceanException
com.myjeeva.digitalocean.exception.DigitalOceanException
public Slave provision(org.jenkinsci.plugins.cloudstats.ProvisioningActivity.Id provisioningId, String dropletName, String cloudName, String authToken, String privateKey, Integer sshKeyId, List<com.myjeeva.digitalocean.pojo.Droplet> droplets, Boolean usePrivateNetworking) throws IOException, com.myjeeva.digitalocean.exception.RequestUnsuccessfulException, Descriptor.FormException
IOException
com.myjeeva.digitalocean.exception.RequestUnsuccessfulException
Descriptor.FormException
public Descriptor<SlaveTemplate> getDescriptor()
getDescriptor
in interface Describable<SlaveTemplate>
public String getName()
public String getSizeId()
public String getRegionId()
public String getLabels()
public String getLabelString()
public boolean isLabellessJobsAllowed()
public String getImageId()
public String getUsername()
public String getWorkspacePath()
public int getNumExecutors()
public int getIdleTerminationInMinutes()
public int getInstanceCap()
public boolean isInstallMonitoring()
public String getTags()
public String getUserData()
public String getInitScript()
public int getSshPort()
public boolean isSetupPrivateNetworking()
protected Object readResolve()
Copyright © 2016–2022. All rights reserved.