Class: Fog::Rackspace::BlockStorage::Volumes

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

Instance Method Summary collapse

Instance Method Details

#allFog::Rackspace::BlockStorage::Volumes

Returns list of volumes



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

def all
  data = service.list_volumes.body['volumes']
  load(data)
end

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

Retrieves volume

Parameters:

  • volume_id (String)

    for snapshot to be returned

Returns:

Raises:

See Also:



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

def get(volume_id)
  data = service.get_volume(volume_id).body['volume']
  new(data)
rescue Fog::Rackspace::BlockStorage::NotFound
  nil
end