public class AWSSchedulerBackend extends Object implements SchedulerBackend
| Constructor and Description |
|---|
AWSSchedulerBackend() |
| Modifier and Type | Method and Description |
|---|---|
Collection<ArnStoppedState> |
checkStoppedTasks(String cluster,
List<String> taskArns)
for given taskArn strings return an ArnStoppedState object for every taskArn
that is stopped or missing in the cluster.
|
com.amazonaws.services.autoscaling.model.AutoScalingGroup |
describeAutoScalingGroup(String autoScalingGroup)
describeAutoScalingGroup.
|
void |
drainInstances(List<DockerHost> hosts,
String clusterName)
set the listed EC2 instances to "draining" state.
|
List<com.amazonaws.services.ecs.model.ContainerInstance> |
getClusterContainerInstances(String cluster)
Get all owned container instances on a cluster.
|
List<com.amazonaws.services.ec2.model.Instance> |
getInstances(Collection<String> instanceIds)
get EC2 Instances for the passed ids.
|
void |
scaleTo(int desiredCapacity,
String autoScalingGroup)
scale the ASG to desired capacity.
|
SchedulingResult |
schedule(DockerHost dockerHost,
String cluster,
SchedulingRequest request,
String taskDefinition) |
void |
suspendProcess(String autoScalingGroupName,
String processName) |
void |
terminateAndDetachInstances(List<DockerHost> hosts,
String asgName,
boolean decrementSize,
String clusterName)
terminate the listed EC2 instances and reduce the size of ASG by the given amount.
|
void |
terminateInstances(List<String> instanceIds)
terminate listed EC2 instances.
|
public List<com.amazonaws.services.ecs.model.ContainerInstance> getClusterContainerInstances(String cluster) throws ECSException
SchedulerBackendgetClusterContainerInstances in interface SchedulerBackendECSExceptionpublic List<com.amazonaws.services.ec2.model.Instance> getInstances(Collection<String> instanceIds) throws ECSException
SchedulerBackendgetInstances in interface SchedulerBackendECSExceptionpublic void scaleTo(int desiredCapacity,
String autoScalingGroup)
throws ECSException
SchedulerBackendscaleTo in interface SchedulerBackendECSExceptionpublic void terminateAndDetachInstances(List<DockerHost> hosts, String asgName, boolean decrementSize, String clusterName) throws ECSException
SchedulerBackendterminateAndDetachInstances in interface SchedulerBackenddecrementSize - should we decrease size of ASG or not? if not, new instance is started eventually.ECSExceptionpublic void terminateInstances(List<String> instanceIds) throws ECSException
SchedulerBackendterminateInstances in interface SchedulerBackendECSExceptionpublic void drainInstances(List<DockerHost> hosts, String clusterName)
SchedulerBackenddrainInstances in interface SchedulerBackendpublic SchedulingResult schedule(DockerHost dockerHost, String cluster, SchedulingRequest request, String taskDefinition) throws ECSException
schedule in interface SchedulerBackendECSExceptionpublic com.amazonaws.services.autoscaling.model.AutoScalingGroup describeAutoScalingGroup(String autoScalingGroup) throws ECSException
describeAutoScalingGroup in interface SchedulerBackendautoScalingGroup - nameECSException - when there are none or multiple matching AGSspublic Collection<ArnStoppedState> checkStoppedTasks(String cluster, List<String> taskArns) throws ECSException
SchedulerBackendcheckStoppedTasks in interface SchedulerBackendECSExceptionpublic void suspendProcess(String autoScalingGroupName, String processName) throws ECSException
suspendProcess in interface SchedulerBackendECSExceptionCopyright © 2022 Atlassian Pty Ltd. All rights reserved.