public abstract class Cloud extends Actionable implements ExtensionPoint, Describable<Cloud>, AccessControlled
Nodes to dynamically expand/shrink the agents attached to Hudson.
Put another way, this class encapsulates different communication protocols needed to start a new agent programmatically.
Cloud. Doing so requires a use of
RetentionStrategy. Instantiate your
Slavesubtype with something like
CloudSlaveRetentionStrategyso that it gets automatically deleted after some idle time.
To do this, have your
Slave subtype remember the necessary handle (such as EC2 instance ID)
as a field. Such fields need to survive the user-initiated re-configuration of
Slave, so you'll need to
expose it in your
configure-entries.jelly and read it back in through
Computer.onRemoved() and use the handle to talk to the "cloud" and de-allocate
the resource (such as shutting down a virtual machine.)
Computer needs to own this handle information
because by the time this happens, a
Slave object is already long gone.
mainview to be presented at the top of the page or at the bottom respectively. In the middle, actions have their
summaryviews displayed. Actions further contribute to
boxviews. All mentioned views are optional to preserve backward compatibility.
|Modifier and Type||Field and Description|
Permission constant to control mutation operations on
|Modifier and Type||Method and Description|
Returns all the registered
Returns true if this cloud is capable of provisioning new nodes for the given label.
Obtains the ACL associated with this object.
Gets the descriptor for this instance.
Returns the URL of this item relative to the parent
Get URL of the cloud.
addAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActions
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public final String name
protected Cloud(String name)
public ACL getACL()
public abstract Collection<NodeProvisioner.PlannedNode> provision(Label label, int excessWorkload)
Nodes from this cloud.
NodeProvisioner performs a trend analysis on the load,
and when it determines that it really needs to bring up
additional nodes, this method is invoked.
The implementation of this method asynchronously starts node provisioning.
label- The label that indicates what kind of nodes are needed now. Newly launched node needs to have this label. Only those
Labels that this instance returned true from the
canProvision(Label)method will be passed here. This parameter is null if Hudson needs to provision a new
Nodefor jobs that don't have any tie to any label.
excessWorkload- Number of total executors needed to meet the current demand. Always ≥ 1. For example, if this is 3, the implementation should launch 3 agents with 1 executor each, or 1 agent with 3 executors, etc.
NodeProvisioner.PlannedNodes that represent asynchronous
Nodeprovisioning operations. Can be empty but must not be null.
NodeProvisionerwill be responsible for adding the resulting
Nodes into Hudson via
Jenkins.addNode(Node), so a
Cloudimplementation just needs to return
NodeProvisioner.PlannedNodes that each contain an object that implements
Future. When the
Futurehas completed its work,
Future.get()will be called to obtain the provisioned
public abstract boolean canProvision(Label label)
public Descriptor<Cloud> getDescriptor()
Descriptor is a singleton for every concrete
implementation, so if
a.getClass() == b.getClass() then by default
a.getDescriptor() == b.getDescriptor() as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
Copyright © 2004–2019. All rights reserved.