Package com.amazonaws.services.autoscaling.model

Examples of com.amazonaws.services.autoscaling.model.AutoScalingGroup


  @Override
  public AutoScalingGroup call() throws Exception {
    GetAutoScalingGroup getTask = new GetAutoScalingGroup(
        getAwsCredentials(), getRegion(), this.autoScalingGroupName);
    AutoScalingGroup autoScalingGroup = getTask.call();
    return awaitGroupSize(autoScalingGroup, this.targetSize);
  }
View Full Code Here


    String taskName = String.format("await-group-size{%d}",
        this.desiredCapacity);
    Callable<AutoScalingGroup> retryableRequest = new RetryableRequest<AutoScalingGroup>(
        requester, retryHandler, taskName);
    try {
      AutoScalingGroup group = retryableRequest.call();
      this.logger.info("group " + group.getAutoScalingGroupName()
          + " reached size " + group.getInstances().size());
    } catch (Exception e) {
      throw new RuntimeException(format(
          "Gave up waiting for scaling group to reach "
              + "capacity %d. You may want to consult the "
              + "scaling activities history of you Auto Scaling "
View Full Code Here

    this.instanceId = instanceId;
  }

  @Override
  public Void call() {
    AutoScalingGroup scalingGroup = new GetAutoScalingGroup(
        getAwsCredentials(), getRegion(), this.autoScalingGroup).call();
    int currentSize = scalingGroup.getDesiredCapacity();

    TerminateInstanceInAutoScalingGroupRequest request = new TerminateInstanceInAutoScalingGroupRequest()
        .withInstanceId(this.instanceId)
        .withShouldDecrementDesiredCapacity(true);
    TerminateInstanceInAutoScalingGroupResult result = getClient().getApi()
View Full Code Here

        desiredSize, 30, 15000);
    String taskName = String.format("await-group-size{%d}", desiredSize);
    Callable<AutoScalingGroup> retryableRequest = new RetryableRequest<AutoScalingGroup>(
        requester, retryHandler, taskName);
    try {
      AutoScalingGroup group = retryableRequest.call();
      this.logger.info("group " + group.getAutoScalingGroupName()
          + " reached size " + group.getInstances().size());
    } catch (Exception e) {
      throw new RuntimeException(format(
          "Gave up waiting for scaling group to reach "
              + "capacity %d. You may want to consult the "
              + "'as-describe-scaling-activities' command "
View Full Code Here

    this.groupName = groupName;
  }

  @Override
  public List<Instance> call() {
    AutoScalingGroup autoScalingGroup = new GetAutoScalingGroup(
        getAwsCredentials(), getRegion(), this.groupName).call();

    return listGroupInstances(autoScalingGroup);
  }
View Full Code Here

        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());
    }
View Full Code Here

        groups.addInstance("anyOtherInstanceId", "anyOtherGroupName");
        List<AutoScalingGroup> list = groups.asList();

        assertEquals(2, list.size());

        AutoScalingGroup firstGroup = list.get(0);
        assertEquals("anyGroupName", firstGroup.getAutoScalingGroupName());

        List<Instance> firstGroupInstances = firstGroup.getInstances();
        assertEquals(1, firstGroupInstances.size());

        assertEquals("anyInstanceId", firstGroupInstances.get(0).getInstanceId());

        AutoScalingGroup secondGroup = list.get(1);
        assertEquals("anyOtherGroupName", secondGroup.getAutoScalingGroupName());

        List<Instance> secondGroupInstances = secondGroup.getInstances();
        assertEquals(1, secondGroupInstances.size());

        assertEquals("anyOtherInstanceId", secondGroupInstances.get(0).getInstanceId());
    }
View Full Code Here

        Assert.assertEquals(instances.get(0), "fake:i-123456789");
    }

    private DescribeAutoScalingGroupsResult mkAsgResult(String asgName, String instanceId) {
        DescribeAutoScalingGroupsResult result = new DescribeAutoScalingGroupsResult();
        AutoScalingGroup asg = new AutoScalingGroup();
        asg.setAutoScalingGroupName(asgName);
        Instance inst = new Instance();
        inst.setInstanceId(instanceId);
        asg.setInstances(Arrays.asList(inst));
        result.setAutoScalingGroups(Arrays.asList(asg));
        return result;
    }
View Full Code Here

public class TestASGChaosCrawler {
    private final ASGChaosCrawler crawler;

    private AutoScalingGroup mkAsg(String asgName, String instanceId) {
        AutoScalingGroup asg = new AutoScalingGroup();
        asg.setAutoScalingGroupName(asgName);
        Instance inst = new Instance();
        inst.setInstanceId(instanceId);
        asg.setInstances(Arrays.asList(inst));
        return asg;
    }
View Full Code Here

    }

    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());
        }
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.autoscaling.model.AutoScalingGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.