Examples of describeInstances()


Examples of com.amazon.ec2.AmazonEC2SkeletonInterface.describeInstances()

        return ec2Service.describeInstanceAttribute(describeInstanceAttribute);
    }

    public DescribeInstancesResponse describeInstances(DescribeInstances describeInstances) {
        AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
        return ec2Service.describeInstances(describeInstances);
    }

    public DescribeKeyPairsResponse describeKeyPairs(DescribeKeyPairs describeKeyPairs) {
        AmazonEC2SkeletonInterface ec2Service = ServiceProvider.getInstance().getServiceImpl(AmazonEC2SkeletonInterface.class);
        return ec2Service.describeKeyPairs(describeKeyPairs);
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2.describeInstances()

        DelegateExecution execution = mock(DelegateExecution.class);
        List<String> instanceIds = Lists.newArrayList("i-123", "i-456");
        when(execution.getVariable(ProcessVariables.INSTANCE_IDS)).thenReturn(instanceIds);

        when(client.describeInstances(Matchers.<DescribeInstancesRequest>any()))
            .thenReturn(new DescribeInstancesResult()
                .withReservations(new Reservation().withInstances(
                    new Instance().withInstanceId("i-123").withPublicDnsName("i1.amazonaws.com")
                        .withPublicIpAddress("1.2.3.4").withPrivateDnsName("i1.internal").withPrivateIpAddress("10.1.2.3"),
                    new Instance().withInstanceId("i-456").withPublicDnsName("i2.amazonaws.com")
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2.describeInstances()

        AmazonEC2 ec2Client = ec2Client();
        DescribeInstancesRequest request = new DescribeInstancesRequest();
        if (instanceIds != null) {
            request.withInstanceIds(Arrays.asList(instanceIds));
        }
        DescribeInstancesResult result = ec2Client.describeInstances(request);
        for (Reservation reservation : result.getReservations()) {
            instances.addAll(reservation.getInstances());
        }

        LOGGER.info(String.format("Got %d EC2 instances in region %s.", instances.size(), region));
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2.describeInstances()

    List<String> instanceIds = new ArrayList<String>();

    for (Instance i : envResources.getEnvironmentResources().getInstances())
      instanceIds.add(i.getId());

    DescribeInstancesResult ec2Instances = ec2
        .describeInstances(new DescribeInstancesRequest()
            .withInstanceIds(instanceIds));

    PrintStream printStream = null;
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2.describeInstances()

        DelegateExecution execution = mock(DelegateExecution.class);
        List<String> instanceIds = Lists.newArrayList("i-123", "i-456");
        when(execution.getVariable(ProcessVariables.INSTANCE_IDS)).thenReturn(instanceIds);

        when(client.describeInstances(Matchers.<DescribeInstancesRequest>any()))
            .thenReturn(new DescribeInstancesResult()
                .withReservations(new Reservation().withInstances(
                    new Instance().withInstanceId("i-123").withPublicDnsName("i1.amazonaws.com")
                        .withPublicIpAddress("1.2.3.4").withPrivateDnsName("i1.internal").withPrivateIpAddress("10.1.2.3"),
                    new Instance().withInstanceId("i-456").withPublicDnsName("i2.amazonaws.com")
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2Client.describeInstances()

        this.instance = startInstances(ec2client, ami_id, ins_type, invocationContext.getExecutionContext().getNotificationService()).get(0);
      else {

        // already running instance
        DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
        DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

        if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
          throw new GfacException("Instance not found:" + ins_id, FaultCode.InvalidRequest);
        }
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2Client.describeInstances()

                this.instance = startInstances(ec2client, ami_id, ins_type, execContext).get(0);
            else {

                // already running instance
                DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
                DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

                if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
                    throw new GfacException("Instance not found:" + ins_id);
                }
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2Client.describeInstances()

                this.instance = startInstances(ec2client, ami_id, ins_type, execContext).get(0);
            else {

                // already running instance
                DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
                DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

                if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
                    throw new GfacException("Instance not found:" + ins_id);
                }
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2Client.describeInstances()

                this.instance = startInstances(ec2client, ami_id, ins_type, execContext).get(0);
            else {

                // already running instance
                DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
                DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

                if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
                    throw new GfacException("Instance not found:" + ins_id);
                }
View Full Code Here

Examples of com.amazonaws.services.ec2.AmazonEC2Client.describeInstances()

                this.instance = startInstances(ec2client, ami_id, ins_type, execContext).get(0);
            else {

                // already running instance
                DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
                DescribeInstancesResult describeInstancesResult = ec2client.describeInstances(describeInstancesRequest.withInstanceIds(ins_id));

                if (describeInstancesResult.getReservations().size() == 0 || describeInstancesResult.getReservations().get(0).getInstances().size() == 0) {
                    throw new GfacException("Instance not found:" + ins_id);
                }
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.