public class Cloud
extends hudson.slaves.AbstractCloudImpl
Cloud contains the main configuration values for running
slaves on DigitalOcean, e.g. apiKey/clientId to connect to the API.
The provision(hudson.model.Label, int) method will be called
by Jenkins as soon as a new slave needs to be provisioned.
The number of| Modifier and Type | Class and Description |
|---|---|
static class |
Cloud.DescriptorImpl |
| Constructor and Description |
|---|
Cloud(String name,
String authToken,
String privateKey,
String sshKeyId,
String instanceCapStr,
List<? extends SlaveTemplate> templates)
Constructor parameters are injected via jelly in the jenkins global configuration
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProvision(hudson.model.Label label) |
int |
countCurrentDropletsSlaves(String imageId)
Count the number of droplets provisioned with the specified Image ID
|
com.myjeeva.digitalocean.impl.DigitalOceanClient |
getApiClient() |
String |
getAuthToken() |
String |
getName() |
String |
getPrivateKey() |
int |
getSshKeyId() |
SlaveTemplate |
getTemplate(hudson.model.Label label) |
List<SlaveTemplate> |
getTemplates() |
Collection<hudson.slaves.NodeProvisioner.PlannedNode> |
provision(hudson.model.Label label,
int excessWorkload)
The actual logic for provisioning a new droplet when it's needed by Jenkins.
|
protected Object |
readResolve() |
getInstanceCap, getInstanceCapStr, setInstanceCap, setInstanceCapStrall, checkPermission, getACL, getDescriptor, getDisplayName, getSearchUrl, hasPermission@DataBoundConstructor public Cloud(String name, String authToken, String privateKey, String sshKeyId, String instanceCapStr, List<? extends SlaveTemplate> templates)
name - A name associated with this cloud configurationauthToken - A DigitalOcean V2 API authentication token, generated on their website.privateKey - An RSA private key in text formatsshKeyId - An identifier (name) for an SSH key known to DigitalOceaninstanceCapStr - the maximum number of instances that can be startedtemplates - the templates for this cloudprotected Object readResolve()
public int countCurrentDropletsSlaves(String imageId) throws com.myjeeva.digitalocean.exception.RequestUnsuccessfulException, com.myjeeva.digitalocean.exception.DigitalOceanException
imageId - an image slug to identify the slaves to countcom.myjeeva.digitalocean.exception.RequestUnsuccessfulExceptioncom.myjeeva.digitalocean.exception.DigitalOceanExceptionpublic Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label, int excessWorkload)
provision in class hudson.slaves.Cloudlabel - excessWorkload - public boolean canProvision(hudson.model.Label label)
canProvision in class hudson.slaves.Cloudpublic List<SlaveTemplate> getTemplates()
public SlaveTemplate getTemplate(hudson.model.Label label)
public String getName()
public String getAuthToken()
public String getPrivateKey()
public int getSshKeyId()
public com.myjeeva.digitalocean.impl.DigitalOceanClient getApiClient()
Copyright © 2004-2015. All Rights Reserved.