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:
parent
0c1ddd97c7
commit
bd544046c0
1 changed files with 16 additions and 2 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue