Module: Aws::EC2::ResourcePaginationFix
- Included in:
 - Resource
 
- Defined in:
 - lib/aws-sdk-ec2/customizations/resource.rb
 
Overview
5 of EC2’s old APIs DescribeInstances, DescribeImages, DescribeSnapshots, DescribeVolumes and DescribeTag support paginated calls and will not paginate server side unless max_results is set to a non-nil value. This module customizes the resource association methods by adding a default value of 1000 to max_results to ensure results are paginated.
Instance Method Summary collapse
- #images(options = {}) ⇒ Object
 - #instances(options = {}) ⇒ Object
 - #snapshots(options = {}) ⇒ Object
 - #volumes(options = {}) ⇒ Object
 
Instance Method Details
#images(options = {}) ⇒ Object
      11 12 13 14 15 16 17 18  | 
    
      # File 'lib/aws-sdk-ec2/customizations/resource.rb', line 11 def images( = {}) # Prevent the error: # The parameter imageIdsSet cannot be used with the parameter maxResults if [:image_ids].nil? || [:image_ids].empty? [:max_results] ||= 1000 end super() end  | 
  
#instances(options = {}) ⇒ Object
      20 21 22 23 24 25 26 27  | 
    
      # File 'lib/aws-sdk-ec2/customizations/resource.rb', line 20 def instances( = {}) # Prevent the error: # The parameter instancesSet cannot be used with the parameter maxResults if [:instance_ids].nil? || [:instance_ids].empty? [:max_results] ||= 1000 end super() end  | 
  
#snapshots(options = {}) ⇒ Object
      29 30 31 32 33 34 35 36  | 
    
      # File 'lib/aws-sdk-ec2/customizations/resource.rb', line 29 def snapshots( = {}) # Prevent the error: # The parameter snapshotSet cannot be used with the parameter maxResults if [:snapshot_ids].nil? || [:snapshot_ids].empty? [:max_results] ||= 1000 end super() end  | 
  
#volumes(options = {}) ⇒ Object
      38 39 40 41 42 43 44 45  | 
    
      # File 'lib/aws-sdk-ec2/customizations/resource.rb', line 38 def volumes( = {}) # Prevent the error: # The parameter volumeIdsSet cannot be used with the parameter maxResults if [:volume_ids].nil? || [:volume_ids].empty? [:max_results] ||= 1000 end super() end  |