Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.46 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Prerequisite: gem install aws-sdk
  2.  
  3. require 'aws'
  4.  
  5. AWS.config(:access_key_id => '***', :secret_access_key => '***')
  6.  
  7. ec2 = AWS::EC2.new
  8. snapshots = ec2.snapshots.filter('volume-id', 'vol-18904770')
  9. snapshots.each { |snapshot| puts snapshot.id }
  10.  
  11. # see: http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/index.html?ApiReference-query-DescribeSnapshots.html
  12. # see: https://github.com/amazonwebservices/aws-sdk-for-ruby/blob/master/lib/aws/ec2/filtered_collection.rb