Class: Fog::Rackspace::BlockStorage::Snapshots

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

Instance Method Summary collapse

Instance Method Details

#allFog::Rackspace::BlockStorage::Snapshots

Returns list of snapshots



17
18
19
20
# File 'lib/fog/rackspace/models/block_storage/snapshots.rb', line 17

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

#get(snapshot_id) ⇒ Fog::Rackspace::BlockStorage::Volume

Retrieves snapshot

Parameters:

  • snapshot_id (String)

    for snapshot to be returned

Returns:

Raises:

See Also:



30
31
32
33
34
35
# File 'lib/fog/rackspace/models/block_storage/snapshots.rb', line 30

def get(snapshot_id)
  data = service.get_snapshot(snapshot_id).body['snapshot']
  new(data)
rescue Fog::Rackspace::BlockStorage::NotFound
  nil
end