lib/link_instances.js
// Handles the paginated response from DescribeClassicLinkInstances
Handles the paginated response from DescribeClassicLinkInstances
Handles the paginated response from DescribeClassicLinkInstances
function _describeClassicLinkInstancesPromise(vpcGroupIds, instances, nextToken) {
    var describeClassicLinkInstancesParams = {
        Filters: [ { Name: 'group-id', Values: vpcGroupIds } ],
        NextToken: nextToken
    };
    return ec2DescribeClassicLinkInstances(describeClassicLinkInstancesParams).then(function(data) {
        data.Instances.forEach(function(instance) {
            instances.push(instance);
        });
        if (data.NextToken) {
            return _describeClassicLinkInstancesPromise(vpcGroupIds, instances, data.NextToken);
        } else {
            return Promise.resolve(instances);
        }
    });
}
function _describeClassicLinkInstancesPromise ( vpcGroupIds , instances , nextToken ) { var describeClassicLinkInstancesParams = { Filters : [ { Name : 'group-id' , Values : vpcGroupIds } ] , NextToken : nextToken } ; return ec2DescribeClassicLinkInstances ( describeClassicLinkInstancesParams ) . then ( function ( data ) { data . Instances . forEach ( function ( instance ) { instances . push ( instance ) ; } ) ; if ( data . NextToken ) { return _describeClassicLinkInstancesPromise ( vpcGroupIds , instances , data . NextToken ) ; } else { return Promise . resolve ( instances ) ; } } ) ; }
Handles the paginated response from DescribeClassicLinkInstances
Handles the paginated response from DescribeClassicLinkInstances
// Add the results to 'instances', where we are accumulating all // the pages. // There is more to the response: Call ourselves again. // The response is complete; we can return.