Example usage for com.amazonaws.services.opsworks.model Instance getInstanceId

List of usage examples for com.amazonaws.services.opsworks.model Instance getInstanceId

Introduction

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

Prototype


public String getInstanceId() 

Source Link

Document

The instance ID.

Usage

From source file:com.tispr.aws.OpsWorksClient.java

License:Apache License

protected List<String> getInstancesIds(String layerId) {
    List<String> instanceIds = new ArrayList<String>();

    if (layerId == null || layerId.isEmpty()) {
        return instanceIds;
    }//from w w w  .ja v  a 2 s. c o  m

    DescribeInstancesRequest req = new DescribeInstancesRequest().withLayerId(layerId);
    DescribeInstancesResult res = opsWorksClient.describeInstances(req);

    for (Instance i : res.getInstances()) {
        instanceIds.add(i.getInstanceId());
    }

    return instanceIds;
}