Skip to content

Instantly share code, notes, and snippets.

@actionjack
Created September 20, 2013 12:20
Show Gist options
  • Select an option

  • Save actionjack/6636642 to your computer and use it in GitHub Desktop.

Select an option

Save actionjack/6636642 to your computer and use it in GitHub Desktop.
AWS-SDK and Fog differences
snapshot_ids.each do |snapshot_id|
AWS.config(:access_key_id => 'AAAAAAAAAAAAAAAAAA', :secret_access_key => 'aaaaaaaaaaaaaaaaaaaa', :region => 'eu-west-1')
ec2 = AWS::EC2.new
current_snap1 = ec2.snapshots[snapshot_id].status
current_snap = Fog::Compute.new({:provider => 'AWS', :region => 'eu-west-1'}).snapshots.all('snapshot-id' => snapshot_id)
p "Snapshot id is #{snapshot_id}"
p current_snap1
p ec2.snapshots[snapshot_id].progress
p "This is the value from the fog library: #{current_snap.inspect}"
p '----------------------------------------------------------'
current_snap.reload
sleep(5)
p current_snap1
p ec2.snapshots[snapshot_id].progress
p "This is the value from the fog library: #{current_snap.inspect}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment