diff --git a/lib/AWS/EC2/snapshots.rb b/lib/AWS/EC2/snapshots.rb index e339517..41ff179 100644 --- a/lib/AWS/EC2/snapshots.rb +++ b/lib/AWS/EC2/snapshots.rb @@ -7,12 +7,14 @@ class Base < AWS::Base # The DescribeSnapshots operation describes the status of Amazon EBS snapshots. # # @option options [optional,Array] :snapshot_id ([]) The ID of the Amazon EBS snapshot. + # @option options [optional,Array] :filters ([]) Array of Hashes of filters. # @option options [optional,String] :owner ('') Returns snapshots owned by the specified owner. Multiple owners can be specified. Valid values self | amazon | AWS Account ID # @option options [optional,String] :restorable_by ('') Account ID of a user that can create volumes from the snapshot. # def describe_snapshots( options = {} ) params = {} params.merge!(pathlist("SnapshotId", options[:snapshot_id] )) unless options[:snapshot_id].nil? || options[:snapshot_id] == [] + params.merge!(pathkvlist("Filter", options[:filters], "Name", "Value", {} )) unless options[:filters].nil? || options[:filters] == [] params["RestorableBy"] = options[:restorable_by] unless options[:restorable_by].nil? params["Owner"] = options[:owner] unless options[:owner].nil? return response_generator(:action => "DescribeSnapshots", :params => params) diff --git a/lib/AWS/EC2/volumes.rb b/lib/AWS/EC2/volumes.rb index dfdbece..71cf4b0 100644 --- a/lib/AWS/EC2/volumes.rb +++ b/lib/AWS/EC2/volumes.rb @@ -6,10 +6,12 @@ class Base < AWS::Base # The DescribeVolumes operation lists one or more Amazon EBS volumes that you own, If you do not specify any volumes, Amazon EBS returns all volumes that you own. # # @option options [optional, String] :volume_id ([]) + # @option options [optional,Array] :filters ([]) Array of Hashes of filters. # def describe_volumes( options = {} ) options = { :volume_id => [] }.merge(options) params = pathlist("VolumeId", options[:volume_id] ) + params.merge!(pathkvlist("Filter", options[:filters], "Name", "Value", {} )) unless options[:filters].nil? || options[:filters] == [] return response_generator(:action => "DescribeVolumes", :params => params) end