2011-01-26 16:35:22 -05:00
|
|
|
module Fog
|
|
|
|
module Parsers
|
2011-06-16 19:28:54 -04:00
|
|
|
module Compute
|
|
|
|
module AWS
|
2011-01-26 16:35:22 -05:00
|
|
|
|
|
|
|
class DescribeReservedInstancesOfferings < Fog::Parsers::Base
|
|
|
|
|
|
|
|
def reset
|
|
|
|
@reserved_instances_offering = {}
|
|
|
|
@response = { 'reservedInstancesOfferingsSet' => [] }
|
|
|
|
end
|
|
|
|
|
|
|
|
def end_element(name)
|
|
|
|
case name
|
2012-11-09 17:13:09 -05:00
|
|
|
when 'availabilityZone', 'currencyCode', 'instanceType', 'offeringType', 'instanceTenancy', 'productDescription', 'reservedInstancesOfferingId'
|
2011-05-12 16:15:13 -04:00
|
|
|
@reserved_instances_offering[name] = value
|
2011-01-26 16:35:22 -05:00
|
|
|
when 'duration'
|
2011-05-12 16:15:13 -04:00
|
|
|
@reserved_instances_offering[name] = value.to_i
|
2011-01-26 16:35:22 -05:00
|
|
|
when 'fixedPrice', 'usagePrice'
|
2011-05-12 16:15:13 -04:00
|
|
|
@reserved_instances_offering[name] = value.to_f
|
2011-01-26 16:35:22 -05:00
|
|
|
when 'item'
|
2012-08-01 11:56:48 -04:00
|
|
|
@response['reservedInstancesOfferingsSet'] << @reserved_instances_offering unless @reserved_instances_offering.empty?
|
2011-01-26 16:35:22 -05:00
|
|
|
@reserved_instances_offering = {}
|
|
|
|
when 'requestId'
|
2011-05-12 16:15:13 -04:00
|
|
|
@response[name] = value
|
2011-01-26 16:35:22 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2011-07-12 20:48:53 -04:00
|
|
|
end
|