List of usage examples for com.amazonaws.services.ec2.model DescribeInstancesRequest setMaxResults
public void setMaxResults(Integer maxResults)
The maximum number of results to return in a single call.
From source file:com.vmware.photon.controller.model.adapters.awsadapter.enumeration.AWSEnumerationAndCreationAdapterService.java
License:Open Source License
/** * Initializes and saves a reference to the request object that is sent to AWS to get a page of instances. Also saves an instance * to the async handler that will be used to handle the responses received from AWS. It sets the nextToken value in the request * object sent to AWS for getting the next page of results from AWS. * @param aws/* w ww . j av a 2 s . c o m*/ */ private void creatAWSRequestAndAsyncHandler(EnumerationCreationContext aws) { DescribeInstancesRequest request = new DescribeInstancesRequest(); Filter runningInstanceFilter = getAWSNonTerminatedInstancesFilter(); request.getFilters().add(runningInstanceFilter); request.setMaxResults(getQueryPageSize()); request.setNextToken(aws.nextToken); aws.describeInstancesRequest = request; AsyncHandler<DescribeInstancesRequest, DescribeInstancesResult> resultHandler = new AWSEnumerationAsyncHandler( this, aws); aws.resultHandler = resultHandler; }