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

[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