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:
parent
8c415efd50
commit
a487abd1e4
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -58,6 +58,11 @@ module Fog
|
|||
end
|
||||
end
|
||||
|
||||
def snapshots
|
||||
requires :id
|
||||
service.snapshots.all('volumeid' => id)
|
||||
end
|
||||
|
||||
def reload
|
||||
requires :identity
|
||||
|
||||
|
|
Loading…
Reference in a new issue