Class DigitalOceanCloud

All Implemented Interfaces:
ExtensionPoint, Describable<Cloud>, ModelObject, SearchableModelObject, SearchItem, AccessControlled, ModelObjectWithContextMenu

public class DigitalOceanCloud extends Cloud
The DigitalOceanCloud 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

Author:
robert.gruendler@dubture.com
  • Constructor Details

    • DigitalOceanCloud

      @Deprecated public DigitalOceanCloud(String name, String authToken, String privateKey, String sshKeyId, String instanceCap, Boolean usePrivateNetworking, String timeoutMinutes, String connectionRetryWait, List<? extends SlaveTemplate> templates)
      Deprecated.
      Constructor parameters are injected via jelly in the jenkins global configuration
      Parameters:
      name - A name associated with this cloud configuration
      authToken - A DigitalOcean V2 API authentication token, generated on their website.
      privateKey - An RSA private key in text format
      sshKeyId - An identifier (name) for an SSH key known to DigitalOcean
      instanceCap - the maximum number of instances that can be started
      usePrivateNetworking - Whether to use private networking to connect to the cloud.
      timeoutMinutes - the timeout in minutes.
      connectionRetryWait - the time to wait for SSH connections to work
      templates - the templates for this cloud
    • DigitalOceanCloud

      @DataBoundConstructor public DigitalOceanCloud(String name, String sshKeyId, String instanceCap, Boolean usePrivateNetworking, String timeoutMinutes, String connectionRetryWait, List<? extends SlaveTemplate> templates)
      Constructor parameters are injected via jelly in the jenkins global configuration
      Parameters:
      name - A name associated with this cloud configuration
      sshKeyId - An identifier (name) for an SSH key known to DigitalOcean
      instanceCap - the maximum number of instances that can be started
      usePrivateNetworking - Whether to use private networking to connect to the cloud.
      timeoutMinutes - the timeout in minutes.
      connectionRetryWait - the time to wait for SSH connections to work
      templates - the templates for this cloud
  • Method Details

    • setPrivateKeyCredentialId

      @DataBoundSetter public void setPrivateKeyCredentialId(String credentialId)
    • setPrivateKey

      @DataBoundSetter @Deprecated public void setPrivateKey(String credential)
      Since:
      1.2.0
    • getPrivateKey

      @Deprecated public String getPrivateKey()
      Deprecated.
      Since:
      1.2.0
    • getPrivateKeyCredentialId

      public String getPrivateKeyCredentialId()
    • setAuthToken

      @DataBoundSetter @Deprecated public void setAuthToken(String credential)
      Since:
      1.2.0
    • setAuthTokenCredentialId

      @DataBoundSetter public void setAuthTokenCredentialId(String credentialId)
    • getAuthTokenCredentialId

      public String getAuthTokenCredentialId()
    • getAuthToken

      @Deprecated public String getAuthToken()
      Since:
      1.2.0
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface ModelObject
      Overrides:
      getDisplayName in class Cloud
    • provision

      public Collection<NodeProvisioner.PlannedNode> provision(Label label, int excessWorkload)
      The actual logic for provisioning a new droplet when it's needed by Jenkins.
      Overrides:
      provision in class Cloud
      Parameters:
      label - name of the field
      excessWorkload - if the workload can be overloaded
      Returns:
      the number of planned nodes
    • canProvision

      public boolean canProvision(Label label)
      Overrides:
      canProvision in class Cloud
    • getName

      public String getName()
    • getAuthTokenFromCredentialId

      public static String getAuthTokenFromCredentialId(String credentialId)
    • getPrivateKeyFromCredentialId

      public static String getPrivateKeyFromCredentialId(String credentialId)
    • getSshKeyId

      public int getSshKeyId()
    • getInstanceCap

      public int getInstanceCap()
    • getApiClient

      public com.myjeeva.digitalocean.impl.DigitalOceanClient getApiClient()
    • getTemplates

      public List<SlaveTemplate> getTemplates()
    • getTimeoutMinutes

      public Integer getTimeoutMinutes()
    • getConnectionRetryWait

      public Integer getConnectionRetryWait()
    • getUsePrivateNetworking

      public Boolean getUsePrivateNetworking()
    • migratePrivateSshKeyToCredential

      public static String migratePrivateSshKeyToCredential(String displayName, String privateKey)
    • migrateAuthTokenToCredential

      public static String migrateAuthTokenToCredential(String displayName, String authToken)
    • readResolve

      protected Object readResolve()