Class: Fog::Compute::Cloudstack::Volumes

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

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
# File 'lib/fog/cloudstack/models/compute/volumes.rb', line 10

def all
  data = service.list_volumes["listvolumesresponse"]["volume"] || []
  load(data)
end

#get(volume_id) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fog/cloudstack/models/compute/volumes.rb', line 15

def get(volume_id)
  if volume = service.list_volumes('id' => volume_id)["listvolumesresponse"]["volume"].first
    new(volume)
  end
rescue Fog::Compute::Cloudstack::BadRequest
  nil
end