jenkins.plugins.jclouds.compute
Class JCloudsCloud

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.slaves.Cloud
          extended by jenkins.plugins.jclouds.compute.JCloudsCloud
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.slaves.Cloud>, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem, hudson.security.AccessControlled

public class JCloudsCloud
extends hudson.slaves.Cloud

The JClouds version of the Jenkins Cloud.

Author:
Vijay Kiran

Nested Class Summary
static class JCloudsCloud.DescriptorImpl
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 String credential
           
 String endPointUrl
           
 String identity
           
 int instanceCap
           
 String privateKey
           
 String profile
           
 String providerName
           
 String publicKey
           
 int scriptTimeout
           
 List<JCloudsSlaveTemplate> templates
           
 
Fields inherited from class hudson.slaves.Cloud
ALL, name, PROVISION
 
Constructor Summary
JCloudsCloud(String profile, String providerName, String identity, String credential, String privateKey, String publicKey, String endPointUrl, int instanceCap, int retentionTime, int scriptTimeout, List<JCloudsSlaveTemplate> templates)
           
 
Method Summary
 boolean canProvision(hudson.model.Label label)
           
 void doProvision(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, String name)
          Provisions a new node manually (by clicking a button in the computer list)
static JCloudsCloud getByName(String name)
           
static List<String> getCloudNames()
           
 org.jclouds.compute.ComputeService getCompute()
           
 int getRetentionTime()
          Get the retention time, defaulting to 30 minutes.
 int getRunningNodesCount()
          Determine how many nodes are currently running for this cloud.
 JCloudsSlaveTemplate getTemplate(hudson.model.Label label)
          Gets JCloudsSlaveTemplate that has the matching Label.
 JCloudsSlaveTemplate getTemplate(String name)
           
 List<JCloudsSlaveTemplate> getTemplates()
           
 Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label, int excessWorkload)
          
protected  Object readResolve()
           
 
Methods inherited from class hudson.slaves.Cloud
all, checkPermission, getACL, getDescriptor, getDisplayName, getSearchUrl, hasPermission
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

identity

public final String identity

credential

public final String credential

providerName

public final String providerName

privateKey

public final String privateKey

publicKey

public final String publicKey

endPointUrl

public final String endPointUrl

profile

public final String profile

instanceCap

public int instanceCap

templates

public final List<JCloudsSlaveTemplate> templates

scriptTimeout

public final int scriptTimeout
Constructor Detail

JCloudsCloud

@DataBoundConstructor
public JCloudsCloud(String profile,
                                         String providerName,
                                         String identity,
                                         String credential,
                                         String privateKey,
                                         String publicKey,
                                         String endPointUrl,
                                         int instanceCap,
                                         int retentionTime,
                                         int scriptTimeout,
                                         List<JCloudsSlaveTemplate> templates)
Method Detail

getCloudNames

public static List<String> getCloudNames()

getByName

public static JCloudsCloud getByName(String name)

readResolve

protected Object readResolve()

getRetentionTime

public int getRetentionTime()
Get the retention time, defaulting to 30 minutes.


getCompute

public org.jclouds.compute.ComputeService getCompute()

getTemplates

public List<JCloudsSlaveTemplate> getTemplates()

provision

public Collection<hudson.slaves.NodeProvisioner.PlannedNode> provision(hudson.model.Label label,
                                                                       int excessWorkload)

Specified by:
provision in class hudson.slaves.Cloud

canProvision

public boolean canProvision(hudson.model.Label label)
Specified by:
canProvision in class hudson.slaves.Cloud

getTemplate

public JCloudsSlaveTemplate getTemplate(String name)

getTemplate

public JCloudsSlaveTemplate getTemplate(hudson.model.Label label)
Gets JCloudsSlaveTemplate that has the matching Label.


doProvision

public void doProvision(org.kohsuke.stapler.StaplerRequest req,
                        org.kohsuke.stapler.StaplerResponse rsp,
                        @QueryParameter
                        String name)
                 throws javax.servlet.ServletException,
                        IOException,
                        hudson.model.Descriptor.FormException
Provisions a new node manually (by clicking a button in the computer list)

Parameters:
req - StaplerRequest
rsp - StaplerResponse
name - Name of the template to provision
Throws:
javax.servlet.ServletException
IOException
Descriptor.FormException

getRunningNodesCount

public int getRunningNodesCount()
Determine how many nodes are currently running for this cloud.



Copyright © 2004-2012. All Rights Reserved.