Package com.dubture.jenkins.digitalocean
Class DigitalOceanCloud
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.slaves.Cloud
com.dubture.jenkins.digitalocean.DigitalOceanCloud
- All Implemented Interfaces:
ExtensionPoint
,Describable<Cloud>
,ModelObject
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithContextMenu
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
Nested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudState
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionDigitalOceanCloud
(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 configurationDigitalOceanCloud
(String name, String authToken, String privateKey, String sshKeyId, String instanceCap, Boolean usePrivateNetworking, String timeoutMinutes, String connectionRetryWait, List<? extends SlaveTemplate> templates) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canProvision
(Label label) com.myjeeva.digitalocean.impl.DigitalOceanClient
Deprecated.static String
getAuthTokenFromCredentialId
(String credentialId) int
getName()
Deprecated.usegetPrivateKey()
static String
getPrivateKeyFromCredentialId
(String credentialId) int
static String
migrateAuthTokenToCredential
(String displayName, String authToken) static String
migratePrivateSshKeyToCredential
(String displayName, String privateKey) The actual logic for provisioning a new droplet when it's needed by Jenkins.protected Object
void
setAuthToken
(String credential) Deprecated.void
setAuthTokenCredentialId
(String credentialId) void
setPrivateKey
(String credential) Deprecated.void
setPrivateKeyCredentialId
(String credentialId) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, reconfigure, reconfigure, registerPermissions
Methods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActions
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendError
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.search.SearchItem
getSearchIcon
-
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 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 DigitalOceaninstanceCap
- the maximum number of instances that can be startedusePrivateNetworking
- Whether to use private networking to connect to the cloud.timeoutMinutes
- the timeout in minutes.connectionRetryWait
- the time to wait for SSH connections to worktemplates
- 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 configurationsshKeyId
- An identifier (name) for an SSH key known to DigitalOceaninstanceCap
- the maximum number of instances that can be startedusePrivateNetworking
- Whether to use private networking to connect to the cloud.timeoutMinutes
- the timeout in minutes.connectionRetryWait
- the time to wait for SSH connections to worktemplates
- the templates for this cloud
-
-
Method Details
-
setPrivateKeyCredentialId
-
setPrivateKey
Deprecated.- Since:
- 1.2.0
-
getPrivateKey
Deprecated.usegetPrivateKey()
- Since:
- 1.2.0
-
getPrivateKeyCredentialId
-
setAuthToken
Deprecated.- Since:
- 1.2.0
-
setAuthTokenCredentialId
-
getAuthTokenCredentialId
-
getAuthToken
Deprecated.- Since:
- 1.2.0
-
getDisplayName
- Specified by:
getDisplayName
in interfaceModelObject
- Overrides:
getDisplayName
in classCloud
-
provision
The actual logic for provisioning a new droplet when it's needed by Jenkins. -
canProvision
- Overrides:
canProvision
in classCloud
-
getName
-
getAuthTokenFromCredentialId
-
getPrivateKeyFromCredentialId
-
getSshKeyId
public int getSshKeyId() -
getInstanceCap
public int getInstanceCap() -
getApiClient
public com.myjeeva.digitalocean.impl.DigitalOceanClient getApiClient() -
getTemplates
-
getTimeoutMinutes
-
getConnectionRetryWait
-
getUsePrivateNetworking
-
migratePrivateSshKeyToCredential
-
migrateAuthTokenToCredential
-
readResolve
-
getAuthTokenCredentialId()