Created
March 31, 2015 01:14
-
-
Save mryoshio/95289dfa2265923b864d to your computer and use it in GitHub Desktop.
How to use PagebleResponse in AWS SDK for Ruby version 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
REGION = 'ap-northeast-1' | |
cloudwatch = Aws::CloudWatch::Client.new(region: REGION) | |
res = cloudwatch.describe_alarms | |
while true | |
res.metric_alarms.each do |al| | |
# some logic for each alarm | |
end | |
if res.last_page? | |
break | |
else | |
res = res.next_page | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment