Package jenkins.plugins.jclouds.compute
Class JCloudsCloud
java.lang.Object
hudson.model.AbstractModelObject
hudson.model.Actionable
hudson.slaves.Cloud
jenkins.plugins.jclouds.compute.JCloudsCloud
- All Implemented Interfaces:
ExtensionPoint
,Describable<Cloud>
,ModelObject
,SearchableModelObject
,SearchItem
,AccessControlled
,ModelObjectWithContextMenu
The JClouds version of the Jenkins Cloud.
- Author:
- Vijay Kiran
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static 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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJCloudsCloud
(String profile, String providerName, String cloudCredentialsId, String cloudGlobalKeyId, String endPointUrl, int instanceCap, int retentionTime, int errorRetentionTime, int scriptTimeout, int startTimeout, String zones, String groupPrefix, boolean trustAll, List<JCloudsSlaveTemplate> templates) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
canProvision
(Cloud.CloudState state) void
doCreate
(StaplerRequest2 req, StaplerResponse2 rsp, String name, String mode, String from) void
doProvision
(StaplerRequest2 req, StaplerResponse2 rsp, String tplname) Provisions a new node manually (by clicking a button in the computer list).Provisions a new node from supplied template.void
doReorder
(StaplerRequest2 req, StaplerResponse2 rsp) int
Get the error retention time in minutes or default value from CloudInstanceDefaults if it is zero.getName()
int
Get the retention time in minutes or default value from CloudInstanceDefaults if it is zero.int
Determine how many nodes are currently running for this cloud.getTemplate
(String name) boolean
<A extends Closeable>
Aboolean
phoneHomeNotify
(String name) provision
(Cloud.CloudState state, int excessWorkload) protected Object
reconfigure
(StaplerRequest2 req, net.sf.json.JSONObject form) void
void
void
setCloudCredentialsId
(String value) void
setCloudGlobalKeyId
(String value) void
setTemplates
(List<JCloudsSlaveTemplate> newTemplates) void
unregisterPhoneHomeMonitor
(jenkins.plugins.jclouds.compute.PhoneHomeMonitor monitor) Methods inherited from class hudson.slaves.Cloud
all, canProvision, doConfigSubmit, doDoDelete, getACL, getDescriptor, getDisplayName, getIcon, getIconAltText, getIconClassName, getSearchUrl, getUrl, provision, 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
-
Field Details
-
providerName
-
endPointUrl
-
profile
-
instanceCap
public int instanceCap -
scriptTimeout
public final int scriptTimeout -
startTimeout
public final int startTimeout -
zones
-
-
Constructor Details
-
JCloudsCloud
@DataBoundConstructor public JCloudsCloud(String profile, String providerName, String cloudCredentialsId, String cloudGlobalKeyId, String endPointUrl, int instanceCap, int retentionTime, int errorRetentionTime, int scriptTimeout, int startTimeout, String zones, String groupPrefix, boolean trustAll, List<JCloudsSlaveTemplate> templates)
-
-
Method Details
-
getName
-
getCloudCredentialsId
-
getTrustAll
public boolean getTrustAll() -
setCloudCredentialsId
-
getCloudGlobalKeyId
-
setCloudGlobalKeyId
-
getGlobalPrivateKey
-
getGlobalPublicKey
-
getGroupPrefix
-
readResolve
-
addTemplate
-
removeTemplate
-
replaceTemplate
-
getRetentionTime
public int getRetentionTime()Get the retention time in minutes or default value from CloudInstanceDefaults if it is zero.- Returns:
- The retention time in minutes.
- See Also:
-
CloudInstanceDefaults.DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES
-
getErrorRetentionTime
public int getErrorRetentionTime()Get the error retention time in minutes or default value from CloudInstanceDefaults if it is zero.- Returns:
- The retention time in minutes.
- See Also:
-
CloudInstanceDefaults.DEFAULT_INSTANCE_RETENTION_TIME_IN_MINUTES
-
newApi
-
newCompute
-
getCompute
-
getTemplates
-
setTemplates
-
provision
public Collection<NodeProvisioner.PlannedNode> provision(Cloud.CloudState state, int excessWorkload) -
canProvision
- Overrides:
canProvision
in classCloud
-
getTemplate
-
getTemplateDescriptor
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public JCloudsSlaveTemplate.DescriptorImpl getTemplateDescriptor() -
doReorder
- Throws:
IOException
-
doCreate
@POST public void doCreate(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter String name, @QueryParameter String mode, @QueryParameter String from) throws IOException, jakarta.servlet.ServletException - Throws:
IOException
jakarta.servlet.ServletException
-
doDoCreate
@POST public HttpResponse doDoCreate(StaplerRequest2 req) throws Descriptor.FormException, IOException, jakarta.servlet.ServletException - Throws:
Descriptor.FormException
IOException
jakarta.servlet.ServletException
-
reconfigure
public Cloud reconfigure(@NonNull StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException - Overrides:
reconfigure
in classCloud
- Throws:
Descriptor.FormException
-
doProvisionFromTemplate
Provisions a new node from supplied template.- Parameters:
t
- The template to be used.- Throws:
IOException
-
doProvision
@POST public void doProvision(StaplerRequest2 req, StaplerResponse2 rsp, @QueryParameter String tplname) throws jakarta.servlet.ServletException, IOException, Descriptor.FormException Provisions a new node manually (by clicking a button in the computer list).- Parameters:
req
-StaplerRequest2
.rsp
-StaplerResponse2
.tplname
- Name of the template to provision.- Throws:
jakarta.servlet.ServletException
- if an error occurs.IOException
- if an error occurs.Descriptor.FormException
- if the form does not validate.
-
getRunningNodesCount
public int getRunningNodesCount()Determine how many nodes are currently running for this cloud.- Returns:
- number of running nodes.
-
unregisterPhoneHomeMonitor
public void unregisterPhoneHomeMonitor(jenkins.plugins.jclouds.compute.PhoneHomeMonitor monitor) -
phoneHomeNotify
-
allowGzippedUserData
public boolean allowGzippedUserData()
-