[cloudstack] Add get snapshots for volume

This commit is contained in:
German Germanovich 2014-11-08 20:22:05 +03:00
parent 8c415efd50
commit a487abd1e4
2 changed files with 8 additions and 2 deletions

View File

@ -7,8 +7,9 @@ module Fog
class Snapshots < Fog::Collection
model Fog::Compute::Cloudstack::Snapshot
def all
data = service.list_snapshots["listsnapshotsresponse"]["snapshot"] || []
def all(attributes = {})
response = service.list_snapshots(attributes)
data = response["listsnapshotsresponse"]["snapshot"] || []
load(data)
end

View File

@ -58,6 +58,11 @@ module Fog
end
end
def snapshots
requires :id
service.snapshots.all('volumeid' => id)
end
def reload
requires :identity