Class: Fog::Scaleway::Compute::Snapshots

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

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
# File 'lib/fog/scaleway/models/compute/snapshots.rb', line 7

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

#get(identity) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fog/scaleway/models/compute/snapshots.rb', line 12

def get(identity)
  if (snapshot = service.get_snapshot(identity).body['snapshot'])
    new(snapshot)
  end
rescue Fog::Scaleway::Compute::UnknownResource
  nil
end