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 classstatic classNested classes/interfaces inherited from class hudson.slaves.Cloud
Cloud.CloudStateNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudsonNested 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 TypeMethodDescriptionvoidbooleanbooleancanProvision(Cloud.CloudState state) voiddoCreate(StaplerRequest2 req, StaplerResponse2 rsp, String name, String mode, String from) voiddoProvision(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.voiddoReorder(StaplerRequest2 req, StaplerResponse2 rsp) intGet the error retention time in minutes or default value from CloudInstanceDefaults if it is zero.getName()intGet the retention time in minutes or default value from CloudInstanceDefaults if it is zero.intDetermine how many nodes are currently running for this cloud.getTemplate(String name) boolean<A extends Closeable>
AbooleanphoneHomeNotify(String name) provision(Cloud.CloudState state, int excessWorkload) protected Objectreconfigure(StaplerRequest2 req, net.sf.json.JSONObject form) voidvoidvoidsetCloudCredentialsId(String value) voidsetCloudGlobalKeyId(String value) voidsetTemplates(List<JCloudsSlaveTemplate> newTemplates) voidunregisterPhoneHomeMonitor(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, registerPermissionsMethods inherited from class hudson.model.Actionable
addAction, addOrReplaceAction, doContextMenu, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, getDynamic, removeAction, removeActions, replaceAction, replaceActionsMethods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError, sendError, sendError, sendErrorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods 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:
canProvisionin 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:
IOExceptionjakarta.servlet.ServletException
-
doDoCreate
@POST public HttpResponse doDoCreate(StaplerRequest2 req) throws Descriptor.FormException, IOException, jakarta.servlet.ServletException - Throws:
Descriptor.FormExceptionIOExceptionjakarta.servlet.ServletException
-
reconfigure
public Cloud reconfigure(@NonNull StaplerRequest2 req, net.sf.json.JSONObject form) throws Descriptor.FormException - Overrides:
reconfigurein 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()
-