use of com.amazonaws.services.autoscaling.model.AutoScalingGroup in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method mkASG.
private AutoScalingGroup mkASG(String asgName) {
AutoScalingGroup asg = new AutoScalingGroup().withAutoScalingGroupName(asgName);
// set the suspended processes
List<SuspendedProcess> sps = new ArrayList<SuspendedProcess>();
sps.add(new SuspendedProcess().withProcessName("Launch").withSuspensionReason("User suspended at 2012-12-02T23:00:03"));
sps.add(new SuspendedProcess().withProcessName("AddToLoadBalancer").withSuspensionReason("User suspended at 2012-12-03T23:00:03"));
asg.setSuspendedProcesses(sps);
return asg;
}
use of com.amazonaws.services.autoscaling.model.AutoScalingGroup in project SimianArmy by Netflix.
the class TestASGJanitorCrawler method verifyASGList.
private void verifyASGList(List<Resource> resources, List<AutoScalingGroup> asgList) {
Assert.assertEquals(resources.size(), asgList.size());
for (int i = 0; i < resources.size(); i++) {
AutoScalingGroup asg = asgList.get(i);
verifyASG(resources.get(i), asg.getAutoScalingGroupName());
}
}
use of com.amazonaws.services.autoscaling.model.AutoScalingGroup in project SimianArmy by Netflix.
the class TestELBJanitorCrawler method testElbsWithNoReferencedASGs.
@Test
public void testElbsWithNoReferencedASGs() {
boolean includeInstances = true;
boolean includeELbs = false;
AWSClient client = createMockAWSClient();
List<LoadBalancerDescription> elbs = createELBList(includeInstances);
List<AutoScalingGroup> asgs = createASGList(includeELbs);
addELBsToMock(client, elbs);
addASGsToMock(client, asgs);
ELBJanitorCrawler crawler = new ELBJanitorCrawler(client);
List<Resource> resources = crawler.resources();
verifyELBList(resources, elbs, 0);
}
use of com.amazonaws.services.autoscaling.model.AutoScalingGroup in project SimianArmy by Netflix.
the class TestELBJanitorCrawler method testElbsWithReferencedASGs.
@Test
public void testElbsWithReferencedASGs() {
boolean includeInstances = true;
boolean includeELbs = true;
AWSClient client = createMockAWSClient();
List<LoadBalancerDescription> elbs = createELBList(includeInstances);
List<AutoScalingGroup> asgs = createASGList(includeELbs);
addELBsToMock(client, elbs);
addASGsToMock(client, asgs);
ELBJanitorCrawler crawler = new ELBJanitorCrawler(client);
List<Resource> resources = crawler.resources();
verifyELBList(resources, elbs, 1);
}
use of com.amazonaws.services.autoscaling.model.AutoScalingGroup in project SimianArmy by Netflix.
the class TestVSphereGroups method shouldReturnListContainigSingleASGWhenAddInstanceIsCalledOnce.
@Test
public void shouldReturnListContainigSingleASGWhenAddInstanceIsCalledOnce() {
VSphereGroups groups = new VSphereGroups();
groups.addInstance("anyInstanceId", "anyGroupName");
List<AutoScalingGroup> list = groups.asList();
assertEquals(1, list.size());
AutoScalingGroup firstItem = list.get(0);
assertEquals("anyGroupName", firstItem.getAutoScalingGroupName());
List<Instance> instances = firstItem.getInstances();
assertEquals(1, instances.size());
assertEquals("anyInstanceId", instances.get(0).getInstanceId());
}
Aggregations