Example usage for com.amazonaws.services.ec2.model Instance toString

List of usage examples for com.amazonaws.services.ec2.model Instance toString

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model Instance toString.

Prototype

@Override
public String toString() 

Source Link

Document

Returns a string representation of this object.

Usage

From source file:org.ow2.petals.cloud.manager.ec2.commands.ListServersCommand.java

License:Open Source License

@Override
protected Object doExecute() throws Exception {
    AmazonEC2 client = getClient();/*from w w  w  .  j a  v a2s . co  m*/
    System.out.println("Servers :");

    DescribeInstancesResult result = client.describeInstances();
    for (Reservation reservation : result.getReservations()) {
        for (Instance instance : reservation.getInstances()) {
            System.out.println(" - " + instance.toString());
        }
    }
    return null;
}