Package org.jenkinsci.plugins.vsphere
Class VSphereCloudRetentionStrategy
java.lang.Object
hudson.slaves.RetentionStrategy<AbstractCloudComputer>
hudson.slaves.CloudRetentionStrategy
org.jenkinsci.plugins.vsphere.VSphereCloudRetentionStrategy
- All Implemented Interfaces:
ExtensionPoint,Describable<RetentionStrategy<?>>
Retains a cloud computer until it has been idle for
getIdleMinutes() minutes (that part
is delegated straight to CloudRetentionStrategy), OR -- optionally -- until it has existed
for getLifespanMinutes() minutes in total, whichever happens first. For example, "keep a
computer around until it's been idle for an hour, or two days have passed, whichever comes first".
lifespanMinutes defaults to 0, which disables the age-based cap entirely and reproduces
this plugin's original keep-until-idle-only behaviour exactly, so existing configurations are
unaffected unless they opt in.
This subsumes what used to be a separate "fixed lifespan" retention strategy evaluated originally in pull request https://github.com/jenkinsci/vsphere-cloud-plugin/pull/96/ : rather than make the user choose one or the other, both conditions are available together on this one strategy.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final classstatic classNested classes/interfaces inherited from class hudson.slaves.RetentionStrategy
RetentionStrategy.Always, RetentionStrategy.DemandNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
FieldsFields inherited from class hudson.slaves.CloudRetentionStrategy
disabledFields inherited from class hudson.slaves.RetentionStrategy
INSTANCE, LIST, NOOP -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongintintbooleanvoidsetLifespanMinutes(int lifespanMinutes) voidMethods inherited from class hudson.slaves.RetentionStrategy
all, isManualLaunchAllowed
-
Field Details
-
DESCRIPTOR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public static final VSphereCloudRetentionStrategy.DescriptorImpl DESCRIPTOR
-
-
Constructor Details
-
VSphereCloudRetentionStrategy
@DataBoundConstructor public VSphereCloudRetentionStrategy(int idleMinutes)
-
-
Method Details
-
getIdleMinutes
public int getIdleMinutes()- See Also:
-
setLifespanMinutes
@DataBoundSetter public void setLifespanMinutes(int lifespanMinutes) -
getLifespanMinutes
public int getLifespanMinutes()- Returns:
- the maximum age, in minutes, before a computer is retired regardless of idleness; 0 means unlimited.
-
check
- Overrides:
checkin classCloudRetentionStrategy
-
isAcceptingTasks
- Overrides:
isAcceptingTasksin classRetentionStrategy<AbstractCloudComputer>
-
start
- Overrides:
startin classCloudRetentionStrategy
-
getDescriptor
-