Class: Stax::Aws::Sdk
- Inherits:
-
Object
- Object
- Stax::Aws::Sdk
- Defined in:
- lib/stax/aws/sdk.rb
Direct Known Subclasses
APIGateway, Acm, Alb, Asg, Cfn, Cloudfront, Codebuild, Codepipeline, Dms, DynamoDB, Ec2, Ecr, Ecs, Elb, Emr, Firehose, Iam, Keypair, Kms, Lambda, Logs, Rds, Route53, S3, SecretsManager, Sg, Sqs, Ssm, Sts
Constant Summary collapse
- RETRY_LIMIT =
ENV['STAX_RETRY_LIMIT'] || 100
Class Method Summary collapse
-
.paginate(thing) ⇒ Object
universal paginator for aws-sdk calls.
Class Method Details
.paginate(thing) ⇒ Object
universal paginator for aws-sdk calls
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/stax/aws/sdk.rb', line 8 def self.paginate(thing) token = nil things = [] loop do resp = yield(token) things += resp.send(thing) ## some apis use marker, some use token token = resp.respond_to?(:next_marker) ? resp.next_marker : resp.next_token break if token.nil? end things end |