
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.46 KB | hits: 11 | expires: Never
# Prerequisite: gem install aws-sdk
require 'aws'
AWS.config(:access_key_id => '***', :secret_access_key => '***')
ec2 = AWS::EC2.new
snapshots = ec2.snapshots.filter('volume-id', 'vol-18904770')
snapshots.each { |snapshot| puts snapshot.id }
# see: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-DescribeSnapshots.html
# see: https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/ec2/filtered_collection.rb