Package com.netflix.simianarmy.client.aws

Examples of com.netflix.simianarmy.client.aws.AWSClient.describeAutoScalingGroups()


                "2012-12-03T23:00:03");
    }

    private AWSClient createMockAWSClient(List<AutoScalingGroup> asgList, String... asgNames) {
        AWSClient awsMock = mock(AWSClient.class);
        when(awsMock.describeAutoScalingGroups(asgNames)).thenReturn(asgList);
        when(awsMock.region()).thenReturn("us-east-1");
        return awsMock;
    }

    private List<AutoScalingGroup> createASGList() {
View Full Code Here


    }

    private AWSClient createMockAWSClient(List<AutoScalingGroup> asgList,
                                          List<LaunchConfiguration> lcList, String... lcNames) {
        AWSClient awsMock = mock(AWSClient.class);
        when(awsMock.describeAutoScalingGroups()).thenReturn(asgList);
        when(awsMock.describeLaunchConfigurations(lcNames)).thenReturn(lcList);
        when(awsMock.region()).thenReturn("us-east-1");
        return awsMock;
    }
View Full Code Here

        List<Resource> resources = Lists.newArrayList();

        AWSClient awsClient = getAWSClient();

        Set<String> usedLCs = Sets.newHashSet();
        for (AutoScalingGroup asg : awsClient.describeAutoScalingGroups()) {
            usedLCs.add(asg.getLaunchConfigurationName());
        }

        for (LaunchConfiguration launchConfiguration : awsClient.describeLaunchConfigurations(launchConfigNames)) {
            String lcName = launchConfiguration.getLaunchConfigurationName();
View Full Code Here

        for (LaunchConfiguration lc : launchConfigurations) {
            nameToLaunchConfig.put(lc.getLaunchConfigurationName(), lc);
        }

        List<Resource> resources = new LinkedList<Resource>();
        for (AutoScalingGroup asg : awsClient.describeAutoScalingGroups(asgNames)) {
            Resource asgResource = new AWSResource().withId(asg.getAutoScalingGroupName())
                    .withResourceType(AWSResourceType.ASG).withRegion(awsClient.region())
                    .withLaunchTime(asg.getCreatedTime());
            for (TagDescription tag : asg.getTags()) {
                asgResource.setTag(tag.getKey(), tag.getValue());
View Full Code Here

        for (Map.Entry<String, AWSClient> entry : regionToAwsClient.entrySet()) {
            String region = entry.getKey();
            AWSClient awsClient = entry.getValue();
            Set<String> asgInstances = Sets.newHashSet();
            LOGGER.info(String.format("Crawling clusters in region %s", region));
            for (AutoScalingGroup asg : awsClient.describeAutoScalingGroups(clusterNames)) {
                List<String> instances = Lists.newArrayList();
                for (Instance instance : asg.getInstances()) {
                    instances.add(instance.getInstanceId());
                    asgInstances.add(instance.getInstanceId());
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.