diff --git a/lib/fog/cloudstack/models/compute/snapshots.rb b/lib/fog/cloudstack/models/compute/snapshots.rb index 44c29d602..e3208fba8 100644 --- a/lib/fog/cloudstack/models/compute/snapshots.rb +++ b/lib/fog/cloudstack/models/compute/snapshots.rb @@ -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 diff --git a/lib/fog/cloudstack/models/compute/volume.rb b/lib/fog/cloudstack/models/compute/volume.rb index 8fc7d7cb2..9a3daf887 100644 --- a/lib/fog/cloudstack/models/compute/volume.rb +++ b/lib/fog/cloudstack/models/compute/volume.rb @@ -58,6 +58,11 @@ module Fog end end + def snapshots + requires :id + service.snapshots.all('volumeid' => id) + end + def reload requires :identity