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

Updated DescribeReservedInstancesOfferings to take in filters as request parameters

This commit is contained in:
Curtis Stewart 2013-03-27 14:27:23 -05:00
parent 0c1ddd97c7
commit bd544046c0

View file

@ -9,6 +9,14 @@ module Fog
#
# ==== Parameters
# * filters<~Hash> - List of filters to limit results with
# * filters and/or the following
# * 'AvailabilityZone'<~String> - availability zone of offering
# * 'InstanceType'<~String> - instance type of offering
# * 'InstanceTenancy'<~String> - tenancy of offering in ['default', 'dedicated']
# * 'OfferingType'<~String> - type of offering, in ['Heavy Utilization', 'Medium Utilization', 'Light Utilization']
# * 'ProductDescription'<~String> - description of offering, in ['Linux/UNIX', 'Linux/UNIX (Amazon VPC)', 'Windows', 'Windows (Amazon VPC)']
# * 'MaxDuration'<~Integer> - maximum duration (in seconds) of offering
# * 'MinDuration'<~Integer> - minimum duration (in seconds) of offering
#
# ==== Returns
# * response<~Excon::Response>:
@ -27,7 +35,13 @@ module Fog
#
# {Amazon API Reference}[http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-DescribeReservedInstancesOfferings.html]
def describe_reserved_instances_offerings(filters = {})
params = Fog::AWS.indexed_filters(filters)
options = {}
for key in ['AvailabilityZone', 'InstanceType', 'InstanceTenancy', 'OfferingType', 'ProductDescription', 'MaxDuration', 'MinDuration']
if filters.is_a?(Hash) && filters.key?(key)
options[key] = filters.delete(key)
end
end
params = Fog::AWS.indexed_filters(filters).merge!(options)
request({
'Action' => 'DescribeReservedInstancesOfferings',
:idempotent => true,