1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[cloudstack] Add get volumes for server

This commit is contained in:
German Germanovich 2014-11-08 20:03:54 +03:00
parent e7d28fe82c
commit 8c415efd50
2 changed files with 9 additions and 3 deletions

View file

@ -50,7 +50,12 @@ module Fog
end
def ip_addresses
addresses.map{|a| a.ip_address}
addresses.map(&:ip_address)
end
def volumes
requires :id
service.volumes.all('virtualmachineid' => id)
end
def public_ip_addresses

View file

@ -7,8 +7,9 @@ module Fog
class Volumes < Fog::Collection
model Fog::Compute::Cloudstack::Volume
def all
data = service.list_volumes["listvolumesresponse"]["volume"] || []
def all(attributes = {})
response = service.list_volumes(attributes)
data = response["listvolumesresponse"]["volume"] || []
load(data)
end