public abstract class CloudProvisioningListener extends Object implements ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
CloudProvisioningListener() |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<CloudProvisioningListener> |
all()
All the registered
CloudProvisioningListener s. |
CauseOfBlockage |
canProvision(Cloud cloud,
Cloud.CloudState state,
int numExecutors)
Allows extensions to prevent a cloud from provisioning.
|
CauseOfBlockage |
canProvision(Cloud cloud,
Label label,
int numExecutors)
Deprecated.
Use
canProvision(Cloud, Cloud.CloudState, int) )} instead. |
void |
onCommit(NodeProvisioner.PlannedNode plannedNode,
Node node)
Called when the
node is fully connected in the Jenkins. |
void |
onComplete(NodeProvisioner.PlannedNode plannedNode,
Node node)
Called when the
NodeProvisioner.PlannedNode.future completes. |
void |
onFailure(NodeProvisioner.PlannedNode plannedNode,
Throwable t)
Called when
NodeProvisioner.PlannedNode.future Future.get() throws an exception. |
void |
onRollback(NodeProvisioner.PlannedNode plannedNode,
Node node,
Throwable t)
Called when
Jenkins.addNode(Node) throws an exception. |
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.
|
@Deprecated public CauseOfBlockage canProvision(Cloud cloud, Label label, int numExecutors)
canProvision(Cloud, Cloud.CloudState, int)
)} instead.cloud
- The cloud being provisioned from.label
- The label which requires additional capacity. IE,
the NodeProvisioner.label
.
May be null if provisioning for unlabeled builds.numExecutors
- The number of executors needed.null
if provisioning can proceed, or a
CauseOfBlockage
reason why it cannot be provisioned.public CauseOfBlockage canProvision(Cloud cloud, Cloud.CloudState state, int numExecutors)
cloud
- The cloud being provisioned from.state
- The current cloud state.numExecutors
- The number of executors needed.null
if provisioning can proceed, or a
CauseOfBlockage
reason why it cannot be provisioned.public void onStarted(Cloud cloud, Label label, Collection<NodeProvisioner.PlannedNode> plannedNodes)
cloud
- the cloud doing the provisioninglabel
- the label which requires additional capacity. IE,
the NodeProvisioner.label
May be null if provisioning for unlabeled builds.plannedNodes
- the planned nodespublic void onComplete(NodeProvisioner.PlannedNode plannedNode, Node node)
NodeProvisioner.PlannedNode.future
completes.plannedNode
- the plannedNode which resulted in the node
being provisionednode
- the node which has been provisioned by the cloudpublic void onCommit(@NonNull NodeProvisioner.PlannedNode plannedNode, @NonNull Node node)
node
is fully connected in the Jenkins.plannedNode
- the plannedNode which resulted in the node
being provisionednode
- the node which has been provisioned by the cloudpublic void onFailure(NodeProvisioner.PlannedNode plannedNode, Throwable t)
NodeProvisioner.PlannedNode.future
Future.get()
throws an exception.plannedNode
- the planned node which failed to provisiont
- the exceptionpublic void onRollback(@NonNull NodeProvisioner.PlannedNode plannedNode, @NonNull Node node, @NonNull Throwable t)
Jenkins.addNode(Node)
throws an exception.plannedNode
- the plannedNode which resulted in the node
being provisionednode
- the node which has been provisioned by the cloudt
- the exceptionpublic static ExtensionList<CloudProvisioningListener> all()
CloudProvisioningListener
s.Copyright © 2004–2022. All rights reserved.