2013-08-12 14:27:22 -04:00
|
|
|
def test
|
|
|
|
|
|
|
|
connection = Fog::Compute.new({ :provider => "Google" })
|
|
|
|
|
2013-08-13 17:51:17 -04:00
|
|
|
# puts 'Listing snapshots...'
|
2013-08-12 14:27:22 -04:00
|
|
|
# puts '---------------------------------'
|
|
|
|
snapshots = connection.snapshots.all
|
|
|
|
raise 'Could not LIST the snapshots' unless snapshots
|
|
|
|
# puts snapshots.inspect
|
|
|
|
|
2013-08-13 17:51:17 -04:00
|
|
|
# puts 'Fetching a single snapshot...'
|
2013-08-12 14:27:22 -04:00
|
|
|
# puts '------------------------------------------------'
|
2013-08-13 17:51:17 -04:00
|
|
|
snap = snapshots.first
|
2013-08-13 17:41:52 -04:00
|
|
|
if !snap.nil?
|
|
|
|
snap = connection.snapshots.get(snap)
|
|
|
|
raise 'Could not GET the snapshot' unless snap
|
|
|
|
# puts snap.inspect
|
|
|
|
end
|
2013-08-12 14:27:22 -04:00
|
|
|
|
|
|
|
end
|