Class AutoScalingGroupFleet
- All Implemented Interfaces:
EC2Fleet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionsoftware.amazon.awssdk.services.autoscaling.AutoScalingClientcreateClient(String awsCredentialsId, String regionName, String endpoint) voiddescribe(String awsCredentialsId, String regionName, String endpoint, ListBoxModel model, String selectedId, boolean showAll) getStateBatch(String awsCredentialsId, String regionName, String endpoint, Collection<String> ids) booleanhasWarmPoolWithInstanceReuse(String awsCredentialsId, String regionName, String endpoint, String autoScalingGroupName) Returnstruewhen this Auto Scaling Group has a warm pool configured with an instance reuse policy that reuses instances on scale-in (ReuseOnScaleIn=true).voidmodify(String awsCredentialsId, String regionName, String endpoint, String id, int targetCapacity, int min, int max) voidscaleDownWithWarmPool(String awsCredentialsId, String regionName, String endpoint, String autoScalingGroupName, Map<String, EC2AgentTerminationReason> instances) Scales the Auto Scaling Group down when it has a warm pool with instance reuse.voidterminateInstances(String awsCredentialsId, String regionName, String endpoint, Collection<String> instanceIds)
-
Constructor Details
-
AutoScalingGroupFleet
public AutoScalingGroupFleet()
-
-
Method Details
-
describe
public void describe(String awsCredentialsId, String regionName, String endpoint, ListBoxModel model, String selectedId, boolean showAll) -
modify
-
getState
public FleetStateStats getState(String awsCredentialsId, String regionName, String endpoint, String id) -
getStateBatch
public Map<String,FleetStateStats> getStateBatch(String awsCredentialsId, String regionName, String endpoint, Collection<String> ids) - Specified by:
getStateBatchin interfaceEC2Fleet
-
isAutoScalingGroup
- Specified by:
isAutoScalingGroupin interfaceEC2Fleet
-
createClient
-
terminateInstances
public void terminateInstances(String awsCredentialsId, String regionName, String endpoint, Collection<String> instanceIds) -
hasWarmPoolWithInstanceReuse
public boolean hasWarmPoolWithInstanceReuse(String awsCredentialsId, String regionName, String endpoint, String autoScalingGroupName) Returnstruewhen this Auto Scaling Group has a warm pool configured with an instance reuse policy that reuses instances on scale-in (ReuseOnScaleIn=true).Only in that case is it safe to scale the ASG down by removing scale-in protection and letting the ASG take the instance, since it is moved to the warm pool for reuse rather than terminated outright. Any failure to look up the warm pool is treated as "no warm pool" so the caller falls back to the pre-warm-pool behavior of terminating instances directly.
-
scaleDownWithWarmPool
public void scaleDownWithWarmPool(String awsCredentialsId, String regionName, String endpoint, String autoScalingGroupName, Map<String, EC2AgentTerminationReason> instances) Scales the Auto Scaling Group down when it has a warm pool with instance reuse.Scale-down instances are handed back to the ASG by removing their scale-in protection, so the ASG moves them to the warm pool for reuse (faster, cache-warm builds) instead of terminating them. Instances that must not be reused (e.g.
MAX_TOTAL_USES_EXHAUSTED) are terminated directly viaterminateInstances(String, String, String, Collection)so the ASG replaces them with a fresh instance.Should only be called when
hasWarmPoolWithInstanceReuse(String, String, String, String)returnedtrue; otherwise useterminateInstances(String, String, String, Collection).
-