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:
parent
e7d28fe82c
commit
8c415efd50
2 changed files with 9 additions and 3 deletions
|
@ -50,7 +50,12 @@ module Fog
|
||||||
end
|
end
|
||||||
|
|
||||||
def ip_addresses
|
def ip_addresses
|
||||||
addresses.map{|a| a.ip_address}
|
addresses.map(&:ip_address)
|
||||||
|
end
|
||||||
|
|
||||||
|
def volumes
|
||||||
|
requires :id
|
||||||
|
service.volumes.all('virtualmachineid' => id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def public_ip_addresses
|
def public_ip_addresses
|
||||||
|
|
|
@ -7,8 +7,9 @@ module Fog
|
||||||
class Volumes < Fog::Collection
|
class Volumes < Fog::Collection
|
||||||
model Fog::Compute::Cloudstack::Volume
|
model Fog::Compute::Cloudstack::Volume
|
||||||
|
|
||||||
def all
|
def all(attributes = {})
|
||||||
data = service.list_volumes["listvolumesresponse"]["volume"] || []
|
response = service.list_volumes(attributes)
|
||||||
|
data = response["listvolumesresponse"]["volume"] || []
|
||||||
load(data)
|
load(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue