Package hudson.slaves
Class CloudProvisioningListener
- java.lang.Object
-
- hudson.slaves.CloudProvisioningListener
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class CloudProvisioningListener extends Object implements ExtensionPoint
- Since:
- 1.520
- Author:
- Ryan Campbell
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description CloudProvisioningListener()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static ExtensionList<CloudProvisioningListener>all()All the registeredCloudProvisioningListeners.CauseOfBlockagecanProvision(Cloud cloud, Label label, int numExecutors)Deprecated.UsecanProvision(Cloud, Cloud.CloudState, int))} instead.CauseOfBlockagecanProvision(Cloud cloud, Cloud.CloudState state, int numExecutors)Allows extensions to prevent a cloud from provisioning.voidonCommit(NodeProvisioner.PlannedNode plannedNode, Node node)Called when thenodeis fully connected in the Jenkins.voidonComplete(NodeProvisioner.PlannedNode plannedNode, Node node)Called when theNodeProvisioner.PlannedNode.futurecompletes.voidonFailure(NodeProvisioner.PlannedNode plannedNode, Throwable t)Called whenNodeProvisioner.PlannedNode.futureFuture.get()throws an exception.voidonRollback(NodeProvisioner.PlannedNode plannedNode, Node node, Throwable t)Called whenJenkins.addNode(Node)throws an exception.voidonStarted(Cloud cloud, Label label, Collection<NodeProvisioner.PlannedNode> plannedNodes)Called after a cloud has returned a PlannedNode, but before that node is necessarily ready for connection.
-
-
-
Method Detail
-
canProvision
@Deprecated public CauseOfBlockage canProvision(Cloud cloud, Label label, int numExecutors)
Deprecated.UsecanProvision(Cloud, Cloud.CloudState, int))} instead.Allows extensions to prevent a cloud from provisioning. Return null to allow provisioning, or non-null to prevent it.- Parameters:
cloud- The cloud being provisioned from.label- The label which requires additional capacity. IE, theNodeProvisioner.label. May be null if provisioning for unlabeled builds.numExecutors- The number of executors needed.- Returns:
nullif provisioning can proceed, or aCauseOfBlockagereason why it cannot be provisioned.
-
canProvision
public CauseOfBlockage canProvision(Cloud cloud, Cloud.CloudState state, int numExecutors)
Allows extensions to prevent a cloud from provisioning. Return null to allow provisioning, or non-null to prevent it.- Parameters:
cloud- The cloud being provisioned from.state- The current cloud state.numExecutors- The number of executors needed.- Returns:
nullif provisioning can proceed, or aCauseOfBlockagereason why it cannot be provisioned.
-
onStarted
public void onStarted(Cloud cloud, Label label, Collection<NodeProvisioner.PlannedNode> plannedNodes)
Called after a cloud has returned a PlannedNode, but before that node is necessarily ready for connection.- Parameters:
cloud- the cloud doing the provisioninglabel- the label which requires additional capacity. IE, theNodeProvisioner.labelMay be null if provisioning for unlabeled builds.plannedNodes- the planned nodes
-
onComplete
public void onComplete(NodeProvisioner.PlannedNode plannedNode, Node node)
Called when theNodeProvisioner.PlannedNode.futurecompletes.- Parameters:
plannedNode- the plannedNode which resulted in thenodebeing provisionednode- the node which has been provisioned by the cloud
-
onCommit
public void onCommit(@NonNull NodeProvisioner.PlannedNode plannedNode, @NonNull Node node)Called when thenodeis fully connected in the Jenkins.- Parameters:
plannedNode- the plannedNode which resulted in thenodebeing provisionednode- the node which has been provisioned by the cloud- Since:
- 2.37
-
onFailure
public void onFailure(NodeProvisioner.PlannedNode plannedNode, Throwable t)
Called whenNodeProvisioner.PlannedNode.futureFuture.get()throws an exception.- Parameters:
plannedNode- the planned node which failed to provisiont- the exception
-
onRollback
public void onRollback(@NonNull NodeProvisioner.PlannedNode plannedNode, @NonNull Node node, @NonNull Throwable t)Called whenJenkins.addNode(Node)throws an exception.- Parameters:
plannedNode- the plannedNode which resulted in thenodebeing provisionednode- the node which has been provisioned by the cloudt- the exception- Since:
- 2.37
-
all
public static ExtensionList<CloudProvisioningListener> all()
All the registeredCloudProvisioningListeners.
-
-