use of com.amazonaws.services.servicediscovery.model.ListInstancesRequest in project aws-doc-sdk-examples by awsdocs.
the class ListInstances method main.
public static void main(String[] args) throws Exception {
AWSCredentials credentials = null;
try {
credentials = new ProfileCredentialsProvider().getCredentials();
} catch (Exception e) {
throw new AmazonClientException("Cannot Load credentials");
}
AWSServiceDiscovery client = AWSServiceDiscoveryClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion("us-east-1").build();
ListInstancesRequest lreq = new ListInstancesRequest();
// Replace with service id
lreq.setServiceId("srv-l7gkxmjapm5givba");
System.out.println(client.listInstances(lreq));
}
Aggregations