Class: Fog::Compute::Google::Snapshots

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/google/models/compute/snapshots.rb

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
14
# File 'lib/fog/google/models/compute/snapshots.rb', line 10

def all
  data = service.list_snapshots
  snapshots = data.body['items'] || []
  load(snapshots)
end

#get(snap_id) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/fog/google/models/compute/snapshots.rb', line 16

def get(snap_id)
  response = service.get_snapshot(snap_id)
  return nil if response.nil?
  new(response.body)
rescue Fog::Errors::NotFound
  nil
end